# Summary tables
# Variables labels are NOT assigned -- need to modify dictionaries above
# when adding or removing variables from summary tables
allcompdf <- as.data.frame(allcomp)
allcompccdf <- as.data.frame(allcomp_cc)
stargazer(allcompdf[c("active_mines" ,"uer","employed", "unemployed",
"labour_force", "pop", "REE_inv","production_shorttons",
"realgdp","realgdp_pc", "ruc", "ruc_bin","total_taa",
"REE_inv_scaled_realgdp")], title = "Summary Statistics: Contiguous US Counties",
covariate.labels = sum_dict)
% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Wed, May 25, 2022 - 17:54:01
\begin{table}[!htbp] \centering
\caption{Summary Statistics: Contiguous US Counties}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lccccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
Statistic & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Mean} & \multicolumn{1}{c}{St. Dev.} & \multicolumn{1}{c}{Min} & \multicolumn{1}{c}{Pctl(25)} & \multicolumn{1}{c}{Pctl(75)} & \multicolumn{1}{c}{Max} \\
\hline \\[-1.8ex]
Active Mines (no.) & 55,296 & 0.462 & 3.723 & 0 & 0 & 0 & 114 \\
Unemployment Rate & 55,296 & 6.130 & 2.720 & 0.800 & 4.200 & 7.500 & 29.400 \\
Employed Persons & 55,296 & 46,504.600 & 149,661.300 & 34 & 4,799 & 30,140.2 & 4,888,581 \\
Unemployed Persons & 55,296 & 2,993.569 & 11,183.150 & 3 & 293 & 1,988.2 & 621,950 \\
Labour Force & 55,296 & 49,498.160 & 159,938.100 & 38 & 5,128 & 32,055.2 & 5,122,843 \\
Population & 55,296 & 99,440.810 & 318,828.000 & 55 & 11,223.5 & 67,553.2 & 10,105,708 \\
Total USDA RE Investments in USD & 55,296 & 114,142.500 & 2,670,894.000 & 0 & 0 & 0 & 250,000,000 \\
Coal Production (in short tons) & 55,296 & 331,540.000 & 6,456,768.000 & 0 & 0 & 0 & 415,924,096 \\
Real GDP & 55,296 & 5,140,646.000 & 22,046,739.000 & 7,648 & 342,473 & 2,550,861 & 726,943,301 \\
Real GDP Per Capita & 55,296 & 50.845 & 463.903 & 5.787 & 25.894 & 46.756 & 59,848.920 \\
Rural-Urban Code & 55,296 & 5.090 & 2.685 & 1 & 3 & 7 & 9 \\
Rural-Urban (binary) & 55,296 & 0.648 & 0.477 & 0 & 0 & 1 & 1 \\
Total TAA Allocation in USD & 55,296 & 11,847,722.000 & 17,737,632.000 & 0 & 0 & 18,184,526 & 128,190,686 \\
USDA RE Investments scaled by Real GDP & 55,296 & 0.091 & 3.073 & 0 & 0 & 0 & 504 \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}
stargazer(allcompccdf[c("active_mines" ,"uer","employed", "unemployed",
"labour_force", "pop", "REE_inv","production_shorttons",
"realgdp","realgdp_pc", "ruc", "ruc_bin","total_taa",
"REE_inv_scaled_realgdp")], title = "Summary Statistics: US Coal Counties",
covariate.labels = sum_dict, type = "text")
Summary Statistics: US Coal Counties
===================================================================================================================
Statistic N Mean St. Dev. Min Pctl(25) Pctl(75) Max
-------------------------------------------------------------------------------------------------------------------
Active Mines (no.) 4,518 5.653 11.847 0 1 5 114
Unemployment Rate 4,518 6.946 2.520 2 5.2 8.3 21
Employed Persons 4,518 29,069.860 58,838.490 816 6,859.2 27,426.2 622,714
Unemployed Persons 4,518 1,933.251 3,535.003 32 477 1,889.8 46,564
Labour Force 4,518 31,003.110 62,186.670 870 7,391.8 29,620.5 651,926
Population 4,518 64,866.890 119,765.600 1,836 16,720.8 64,536.8 1,265,577
Total USDA RE Investments in USD 4,518 27,055.950 333,439.800 0 0 0 10,005,017
Coal Production (in short tons) 4,518 4,057,556.000 22,253,668.000 0 0 3,564,906.0 415,924,096
Real GDP 4,518 3,045,039.000 7,913,160.000 47,597 590,750.2 2,623,148 92,984,370
Real GDP Per Capita 4,518 41.688 25.763 8.221 26.348 48.551 244.161
Rural-Urban Code 4,518 5.116 2.376 1 3 7 9
Rural-Urban (binary) 4,518 0.697 0.460 0 0 1 1
Total TAA Allocation in USD 4,518 14,597,789.000 20,533,595.000 0 0 23,427,230 117,476,517
USDA RE Investments scaled by Real GDP 4,518 0.016 0.241 0 0 0 9
-------------------------------------------------------------------------------------------------------------------
stargazer(allcompdf[c("diff_uer", "mines_diff","diff_log_realgdp",
"diff_log_realgdp_pc", "diff_log_employed",
"diff_log_unemployed", "diff_log_lf", "diff_log_pop",
"REE_bin_top90") ],
title = "Summary Statistics of Transformed Variables: Contiguous US Counties",
covariate.labels = sum_dict_trans, type = "text")
Summary Statistics of Transformed Variables: Contiguous US Counties
==================================================================================
Statistic N Mean St. Dev. Min Pctl(25) Pctl(75) Max
----------------------------------------------------------------------------------
Δ Unemployment Rate 55,296 -0.061 1.228 -8.600 -0.700 0.300 13.500
Δ Active Mines 55,296 -0.015 0.605 -30 0 0 20
Δ (log) Real GDP 55,295 0.017 0.088 -1.122 -0.017 0.048 1.386
Δ (log) Real GDP per capita 55,295 0.014 0.088 -1.126 -0.020 0.043 1.391
Δ (log) Employed Persons 55,296 0.001 0.037 -0.596 -0.013 0.018 1.022
Δ (log) Unemployed Persons 55,296 -0.013 0.177 -0.852 -0.124 0.057 1.305
Δ (log) Labour Force 55,296 0.001 0.034 -0.562 -0.013 0.015 0.986
Δ (log) Population 55,295 0.003 0.014 -0.425 -0.005 0.009 0.290
REE ≥ .1% of GDP 55,296 0.127 0.333 0 0 0 1
----------------------------------------------------------------------------------
stargazer(allcompccdf[c("diff_uer", "mines_diff","diff_log_realgdp",
"diff_log_realgdp_pc", "diff_log_employed",
"diff_log_unemployed", "diff_log_lf", "diff_log_pop",
"REE_bin_top90") ],
title = "Summary Statistics of Transformed Variables: US Coal Counties Subset",
covariate.labels = sum_dict_trans, type = "text")
Summary Statistics of Transformed Variables: US Coal Counties Subset
=================================================================================
Statistic N Mean St. Dev. Min Pctl(25) Pctl(75) Max
---------------------------------------------------------------------------------
Δ Unemployment Rate 4,518 -0.056 1.322 -4.600 -0.793 0.400 8.300
Δ Active Mines 4,518 -0.182 2.109 -30 0 0 20
Δ (log) Real GDP 4,518 0.010 0.081 -0.604 -0.022 0.038 1.342
Δ (log) Real GDP per capita 4,518 0.010 0.080 -0.594 -0.021 0.037 1.351
Δ (log) Employed Persons 4,518 -0.002 0.035 -0.440 -0.015 0.014 0.214
Δ (log) Unemployed Persons 4,518 -0.014 0.179 -0.479 -0.120 0.051 1.077
Δ (log) Labour Force 4,518 -0.003 0.031 -0.396 -0.015 0.012 0.185
Δ (log) Population 4,518 -0.0004 0.010 -0.098 -0.006 0.004 0.066
REE ≥ .1% of GDP 4,518 0.097 0.296 0 0 0 1
---------------------------------------------------------------------------------
Overall Research Question: Do various indicators for changes in coal activity impact various county-level employment indicators?
Employs standard two-way fixed effects panel regressions with county-clustered standard errors to a panel dataset of 3,072 contiguous counties observed between 2002-2019.
Results:
Models 1: Significant change in unemployment rate in time t (in expected direction). Impact is near zero (albeit consistent sign as in t) in t+1 and changes sign in t+2 indicating a level effect as opposed to a growth effect. A one-unit decrease (increase) in active mines is associated with an increase (decrease) in the unemployment rate of 0.06 percentage points, negligible change in t+1 of the same direction, with a sign change and decrease(boost) of 0.03 percentage points. 1% significance level in time t. Indicates a non-growth effect with initial shock in time t (potentially t+1) but correcting again in t+2. (same conclusion for subset of coal counties).
Models 2/3: Change in employed/unemployed persons is also significant and in the expected direction. A one-unit increase in active mines is associated with a 0.12% increase in the total number of employed persons in time t (5% significance level) and 0.17% in time t+1 at the 1% significance level. (same conclusion for subset of coal counties)
Models 4: Change in labour force is only significant in t+1 indicating that individuals might leave the labour force following a mine closure. Though the result is very small… (same conclusion for subset of coal counties)
Models 5: Change in population is negligible (both in significance and magnitude). (same conclusion for subset of coal counties)
# Level UER and level mines with various lags
lev22 <- feols(uer ~ l(active_mines, -2:0) + lag_mines + lag_mines2 + log_realgdp_pc |
fips + year, allcomp, panel.id = ~fips+year, se = 'twoway')
lev33 <- feols(uer ~ l(active_mines, -3:0) + lag_mines + lag_mines2 + lag_mines3 + log_realgdp_pc |
fips + year, allcomp, panel.id = ~fips+year, se = 'twoway')
lev03 <- feols(uer ~ active_mines + lag_mines +lag_mines2 + lag_mines3 + log_realgdp_pc |
fips + year, allcomp, se = 'twoway')
lev02 <- feols(uer ~ active_mines + lag_mines +lag_mines2 + log_realgdp_pc |
fips + year, allcomp, se = 'twoway')
# Level UER and mine levels on coal county subset
lev22cc <- feols(uer ~ l(active_mines, -2:0) + lag_mines + lag_mines2 + log_realgdp_pc |
fips + year, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
lev33cc <- feols(uer ~ l(active_mines, -3:0) + lag_mines + lag_mines2 + lag_mines3 + log_realgdp_pc |
fips + year, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
lev03cc <- feols(uer ~ active_mines + lag_mines +lag_mines2 + lag_mines3 + log_realgdp_pc |
fips + year, allcomp_cc, se = 'twoway')
lev02cc <- feols(uer ~ active_mines + lag_mines +lag_mines2 + log_realgdp_pc |
fips + year, allcomp_cc, se = 'twoway')
etable(lev03, lev22, lev33, lev03cc, lev22cc, lev33cc, order = c("active_mines,3", "active_mines,2", "active_mines,1", "Active Mines", "log_realgdp_pc"))
# Level mines and log emp indicators
lev_emplog <- feols(log_employed ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
lev_unemplog <- feols(log_unemployed ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
lev_lflog <- feols(log_lf ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop|
fips + year, allcomp, se = 'twoway')
lev_poplog <- feols(log_pop ~ active_mines + lag_mines + lag_mines2 + log_realgdp |
fips + year, allcomp, se = 'twoway')
etable(lev02, lev_emplog, lev_unemplog, lev_lflog, lev_poplog)
# Levels of everything
lev_emp <- feols(employed ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
lev_unemp <- feols(unemployed ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
lev_lf <- feols(labour_force ~ active_mines + lag_mines + lag_mines2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
lev_pop <- feols(pop ~ active_mines + lag_mines + lag_mines2 + log_realgdp |
fips + year, allcomp, se = 'twoway')
etable(lev_emp, lev_unemp, lev_lf, lev_pop)
# log dependent variables first-difference independent variables
uer_diff <- feols(uer ~ mines_diff + lag_diff + lag_diff2 + log_realgdp_pc |
fips + year, allcomp, se = 'twoway')
log_emp <- feols(log_employed ~ mines_diff + lag_diff + lag_diff2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
log_unemp <- feols(log_unemployed ~ mines_diff + lag_diff + lag_diff2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
log_lf <- feols(log_lf ~ mines_diff + lag_diff + lag_diff2 + log_realgdp + log_pop |
fips + year, allcomp, se = 'twoway')
log_pop <- feols(log_pop ~ mines_diff + lag_diff + lag_diff2 + log_realgdp |
fips + year, allcomp, se = 'twoway')
etable(uer_diff, log_emp, log_unemp, log_lf, log_pop)
The coefficient estimates are the same in each of these models isolating each variable.
etable("t" = feols(diff_uer ~ mines_diff + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'),
"t-1" = feols(diff_uer ~ lag_diff + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'),
"t-2" = feols(diff_uer ~ lag_diff2 + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'),
"t-3" = feols(diff_uer ~ lag_diff3 + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'),
"t" = feols(diff_uer ~ mines_diff + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'),
"t-1" = feols(diff_uer ~ lag_diff + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'),
"t-2" = feols(diff_uer ~ lag_diff2 + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'),
"t-3" = feols(diff_uer ~ lag_diff3 + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'),tex= TRUE,
signifCode = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1))
\begin{tabular}{lcccccccc}
\tabularnewline\midrule\midrule
Dependent Variable: & \multicolumn{8}{c}{Change Unemployment Rate}\\
Model: & (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8)\\
\midrule \emph{Variables} & & & & & & & & \\
Change Active Mines & -0.0560$^{**}$ & & & & -0.0416$^{**}$ & & & \\
& (0.0151) & & & & (0.0127) & & & \\
Change in (log) Real GDP pc & -0.9742$^{***}$ & -0.9837$^{***}$ & -0.9846$^{***}$ & -0.9842$^{***}$ & -1.596$^{***}$ & -1.699$^{***}$ & -1.701$^{***}$ & -1.702$^{***}$\\
& (0.2137) & (0.2137) & (0.2138) & (0.2136) & (0.3513) & (0.3482) & (0.3416) & (0.3469)\\
Change Active Mines (t-1) & & -0.0050 & & & & -0.0029 & & \\
& & (0.0137) & & & & (0.0096) & & \\
Change Active Mines (t-2) & & & 0.0402$^{*}$ & & & & 0.0351$^{**}$ & \\
& & & (0.0151) & & & & (0.0116) & \\
Change Active Mines (t-3) & & & & 0.0011 & & & & 0.0026\\
& & & & (0.0136) & & & & (0.0098)\\
\midrule \emph{Fixed-effects} & & & & & & & & \\
County FIPS Code & Yes & Yes & Yes & Yes & Yes & Yes & Yes & Yes\\
Year & Yes & Yes & Yes & Yes & Yes & Yes & Yes & Yes\\
\midrule \emph{Fit statistics} & & & & & & & & \\
Observations & 55,295 & 55,295 & 55,295 & 55,295 & 4,518 & 4,518 & 4,518 & 4,518\\
R$^2$ & 0.61298 & 0.61227 & 0.61267 & 0.61226 & 0.65184 & 0.64795 & 0.65105 & 0.64794\\
Within R$^2$ & 0.01367 & 0.01186 & 0.01288 & 0.01185 & 0.03705 & 0.02628 & 0.03487 & 0.02627\\
\midrule\midrule\multicolumn{9}{l}{\emph{Clustered (County FIPS Code \& Year) standard-errors in parentheses}}\\
\multicolumn{9}{l}{\emph{Signif. Codes: ***: 0.001, **: 0.01, *: 0.05, .: 0.1}}\\
\end{tabular}
# Regresses the change in unemployment rate, employed person, unemployed
# persons, labour force, population on change in mines and two time lags using
# full set of 3,079 contiguous US counties.
FE_diffuer <- as.formula("diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc | fips + year")
FE_negdiffuer <- as.formula("neg_diffuer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc | fips + year")
FE_negdiffuer3 <- as.formula("neg_diffuer ~ mines_diff + lag_diff + lag_diff2 +lag_diff3 + diff_log_realgdp_pc | fips + year")
es <- feols(FE_negdiffuer, allcomp_full, panel.id = ~fips+year, se = 'twoway')
es_cc <- feols(FE_negdiffuer, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
es3 <- feols(FE_negdiffuer3, allcomp_full, panel.id = ~fips+year, se = 'twoway')
es3_cc <- feols(FE_negdiffuer3, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
es_2neg <- feols(neg_diffuer ~ l(mines_diff, -2:0) + lag_diff + lag_diff2 + diff_log_realgdp_pc |
fips + year, allcomp_full, panel.id = ~fips+year, se = 'twoway')
es_3neg <- feols(neg_diffuer ~ l(mines_diff, -3:0) + lag_diff + lag_diff2 + lag_diff3 + diff_log_realgdp_pc |
fips + year, allcomp_full, panel.id = ~fips+year, se = 'twoway')
es_2negcc <- feols(neg_diffuer ~ l(mines_diff, -2:0) + lag_diff + lag_diff2 + diff_log_realgdp_pc |
fips + year, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
es_3negcc <- feols(neg_diffuer ~ l(mines_diff, -3:0) + lag_diff + lag_diff2 + lag_diff3 + diff_log_realgdp_pc |
fips + year, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
etable(es, es_cc, es3, es3_cc, es_2neg, es_2negcc, es_3neg, es_3negcc)
fill_colors <- c(NA, "#39568CFF", "#95D840FF")
line_colors <- c(NA, "#440154FF", "#287D8EFF")
setFixest_coefplot(pt.join = TRUE, ci.join = FALSE, ci.fill = TRUE, ci.col = fill_colors,
pt.col = line_colors, pt.pch = c(0, 19, 25), pt.bg = line_colors,
pt.cex = 1, ci.fill.par = list(col = fill_colors, alpha = 0.3),
ci.lty = "dashed", ref.line = TRUE, ref.line.par = list(v = 4, col = "gray", lty = "solid"),
grid = TRUE, grid.par = list(vert = FALSE, lwd = 1), dict = plot_dict)
es_blank <- feols(diff_uer ~ l(mines_diff, -3:0) + lag_diff + lag_diff2 + lag_diff3 + diff_log_realgdp_pc |
fips + year, allcomp_cc, panel.id = ~fips+year, se = 'twoway')
coefplot(list(es_3negcc, es3, es3_cc), drop = c('diff_log_realgdp_pc'), xlim.add = c(0,0.001))
coefplot(list(es_blank, es_2neg, es_2negcc), drop = c('diff_log_realgdp_pc'), xlim.add = c(0,0.06))
coefplot(list(es_blank, es_3neg, es_3negcc), drop = c('diff_log_realgdp_pc'), xlab = "Years since negative change in active mines")
plot(NULL ,xaxt='n',yaxt='n',bty='n',ylab='',xlab='', xlim=0:1, ylim=0:1)
legend("topleft", legend = c("US Counties", "Coal Counties Only", "95% Confidence Interval", "95% Confidence Interval"),
col = c("#440154FF", "#287D8EFF", "#39568C4D", "#95D8404D"),
pt.bg = c("#440154FF", "#287D8EFF", NA, NA),
pch = c(19,25,15,15),
bty = "n",
pt.cex = c(1.5,1.5,3.5,3.5),
cex = 1,
text.col = "black",
ncol = 2,
lty = c("solid", "solid", NA, NA),
y.intersp = 1.5
)
Research Question: Are changes in the amount of active mines associated with changes in the unemployment rate, conditional on whether a county is rural or not? Ie. do changes in active mines impact rural and urban counties differently?
Results:
# First (second) model uses set of all US counties (subset of coal counties only).
etable("Model 6_i" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:ruc_bin + lag_diff:ruc_bin + lag_diff2:ruc_bin + diff_log_realgdp_pc |
fips + year, allcomp, se = 'twoway'),
"Model 6_i CC" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:ruc_bin + lag_diff:ruc_bin + lag_diff2:ruc_bin + diff_log_realgdp_pc |
fips + year, allcomp_cc, se = 'twoway'))
Research Question: What is the impact of a positive (negative) change in active mines on county-level unemployment rate?
The point estimates indicate a potential asymmetric treatment (mine closures lead to a larger change in unemployment rate as compared to the opening of a mine) effect but is not statistically significant.
Potential interesting result shows that the coefficient on change in mines is restricted to NEGATIVE changes. Essentially, this evidence shows that positive changes in active mines do not provide “windfall” employment, indicating that the solution is not to RETAIN or re-invigorate the mining sector.
main <- feols(FE_diffuer, allcomp, se = 'twoway')
main_cc <- feols(FE_diffuer, allcomp_cc, se = 'twoway')
allcomp$pos_difflag <- ifelse(allcomp$lag_diff >= 0, 1, 0)
allcomp$pos_difflag2 <- ifelse(allcomp$lag_diff2 >= 0, 1, 0)
allcomp$neg_difflag <- ifelse(allcomp$lag_diff < 0, 1, 0)
allcomp$neg_difflag2 <- ifelse(allcomp$lag_diff2 < 0, 1, 0)
# Uses binary indicators for whether a change in active mines was positive (or zero)
# versus negative.
# Below uses set of all contiguous US counties
model_7_neg= feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + neg_diff:mines_diff +
neg_difflag:lag_diff + neg_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, allcomp, se = 'twoway')
model_8_pos = feols(diff_uer ~ mines_diff + lag_diff +lag_diff2 + pos_diff:mines_diff +
pos_difflag:lag_diff + pos_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, allcomp, se = 'twoway')
model_9_both = feols(diff_uer ~ neg_diff:mines_diff + neg_difflag:lag_diff + neg_difflag2:lag_diff2 + pos_diff:mines_diff + pos_difflag:lag_diff + pos_difflag2:lag_diff2 + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway')
etable(model_7_neg, model_8_pos, model_9_both, signifCode = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1))
etable(model_9_both)
# Mines_diff is different from zero (statistically significant at the .1% level) (-0.056%)
glht(main, linfct = "mines_diff = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = FE_diffuer, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff == 0 -0.05630 0.01408 -3.998 6.4e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Adjusted p values reported -- single-step method)
glht(main, linfct = "mines_diff + lag_diff + lag_diff2 = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = FE_diffuer, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff + lag_diff + lag_diff2 == 0 -0.02443 0.02690 -0.908 0.364
(Adjusted p values reported -- single-step method)
#glht(main, linfct = mcp(tension = c("mines_diff = 0", "mines_diff + lag_diff + lag_diff2 = 0")))
# Mines_diff + mines_diff:neg_diff is different from zero (statistically significant at the 1% level)
# Higher coefficient value than in broader model (-0.078%)
glht(model_7_neg, linfct = "mines_diff + mines_diff:neg_diff = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = diff_uer ~ mines_diff + lag_diff + lag_diff2 + neg_diff:mines_diff +
neg_difflag:lag_diff + neg_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff + mines_diff:neg_diff == 0 -0.07520 0.02346 -3.206 0.00135 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Adjusted p values reported -- single-step method)
glht(model_7_neg, linfct = "mines_diff + mines_diff:neg_diff + lag_diff + lag_diff:neg_difflag + lag_diff2 + lag_diff2:neg_difflag2 = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = diff_uer ~ mines_diff + lag_diff + lag_diff2 + neg_diff:mines_diff +
neg_difflag:lag_diff + neg_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate
mines_diff + mines_diff:neg_diff + lag_diff + lag_diff:neg_difflag + lag_diff2 + lag_diff2:neg_difflag2 == 0 -0.05065
Std. Error
mines_diff + mines_diff:neg_diff + lag_diff + lag_diff:neg_difflag + lag_diff2 + lag_diff2:neg_difflag2 == 0 0.03093
t value
mines_diff + mines_diff:neg_diff + lag_diff + lag_diff:neg_difflag + lag_diff2 + lag_diff2:neg_difflag2 == 0 -1.638
Pr(>|t|)
mines_diff + mines_diff:neg_diff + lag_diff + lag_diff:neg_difflag + lag_diff2 + lag_diff2:neg_difflag2 == 0 0.101
(Adjusted p values reported -- single-step method)
# Mines_diff and pos_diff is different from zero although not statistically significant and at a much lower magnitude! (-0.021%)
glht(model_8_pos, linfct = "mines_diff + mines_diff:pos_diff = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = diff_uer ~ mines_diff + lag_diff + lag_diff2 + pos_diff:mines_diff +
pos_difflag:lag_diff + pos_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff + mines_diff:pos_diff == 0 -0.01931 0.02006 -0.962 0.336
(Adjusted p values reported -- single-step method)
glht(model_8_pos, linfct = "mines_diff + mines_diff:pos_diff + lag_diff + lag_diff:pos_difflag + lag_diff2 + lag_diff2:pos_difflag2 = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = diff_uer ~ mines_diff + lag_diff + lag_diff2 + pos_diff:mines_diff +
pos_difflag:lag_diff + pos_difflag2:lag_diff2 + diff_log_realgdp_pc |
fips + year, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate
mines_diff + mines_diff:pos_diff + lag_diff + lag_diff:pos_difflag + lag_diff2 + lag_diff2:pos_difflag2 == 0 0.01170
Std. Error
mines_diff + mines_diff:pos_diff + lag_diff + lag_diff:pos_difflag + lag_diff2 + lag_diff2:pos_difflag2 == 0 0.05724
t value
mines_diff + mines_diff:pos_diff + lag_diff + lag_diff:pos_difflag + lag_diff2 + lag_diff2:pos_difflag2 == 0 0.204
Pr(>|t|)
mines_diff + mines_diff:pos_diff + lag_diff + lag_diff:pos_difflag + lag_diff2 + lag_diff2:pos_difflag2 == 0 0.838
(Adjusted p values reported -- single-step method)
The typology work is not included in this set of results. The following regressions take the set of 251 coal counties (as defined above) and subset into three groups depending on whether they are Type 1, 2, or 3 counties (see summary table in paper draft).
Results:
main <- feols(FE_diffuer, allcomp, se = 'twoway')
main_cc <- feols(FE_diffuer, allcomp_cc, se = 'twoway')
##### Run regressions from previous section incorporating the type of county. ########
# The county types (1,2,3) are derived from the clustering typology exercise outlined in the paper draft.
# Types are as follows: (rural:1; medium:2, urban:3)
cc_urbandf <- allcomp_cc_types %>% subset(type == 1)
cc_mediumdf <- allcomp_cc_types %>% subset(type == 2)
cc_ruraldf <- allcomp_cc_types %>% subset(type == 3)
cc_rural = feols(FE_diffuer, cc_ruraldf, se = "twoway")
cc_medium = feols(FE_diffuer, cc_mediumdf, se = "twoway")
cc_urban = feols(FE_diffuer, cc_urbandf, se = "twoway")
rural_2neg <- feols(diff_uer ~ l(mines_diff, -1:0) + lag_diff + lag_diff2 + lag_diff3 + diff_log_realgdp_pc |
fips + year, cc_ruraldf, panel.id = ~fips+year, se = 'twoway')
medium_2neg <- feols(diff_uer ~ l(mines_diff, -1:0) + lag_diff + lag_diff2 + lag_diff3 + diff_log_realgdp_pc |
fips + year, cc_mediumdf, panel.id = ~fips+year, se = 'twoway')
urban_2neg <- feols(diff_uer ~ l(mines_diff, -1:0) + lag_diff + lag_diff2 + lag_diff3 +diff_log_realgdp_pc |
fips + year, cc_urbandf, panel.id = ~fips+year, se = 'twoway')
fill_colors <- c("#39568CFF", "#95D840FF", "#eb7134")
line_colors <- c("#440154FF", "#287D8EFF", "#eb7134")
setFixest_coefplot(pt.join = TRUE, pt.join.par = list(lwd = 2, lty = c("solid", "dashed", "dashed")),
ci.join = TRUE, ci.join.par = list(lty = c("dashed", "blank", "blank"), lwd = 0.5, col = line_colors), ci.fill = TRUE, ci.col = fill_colors,
pt.col = line_colors, pt.pch = c(25, 23, 19), pt.bg = line_colors,
pt.cex = 1, ci.fill.par = list(col = fill_colors, alpha = 0.1), ci.lwd = 0.5,
ci.lty = "blank", ref.line = TRUE, ref.line.par = list(v = 2, col = "gray", lty = "solid"),
grid = TRUE, grid.par = list(vert = FALSE, lwd = 1), dict = plot_dict, sep = 0)
coefplot(list(rural_2neg, medium_2neg, urban_2neg),drop = c('diff_log_realgdp_pc'), xlab = "Years since negative change in active mines")
legend("topright", legend = c("Type 1", "Type 2", "Type 3"), col = c( "#eb7134","#287D8EFF","#440154FF"), pt.bg= c( "#eb7134","#287D8EFF","#440154FF"), pch = c(19, 23, 25), cex = 1,
text.col = "black", lty = c("dashed", "dashed", "solid"))
# coefplot(list(rural_2neg),drop = c('diff_log_realgdp_pc'))
# coefplot(list(medium_2neg),drop = c('diff_log_realgdp_pc'))
# coefplot(list(urban_2neg),drop = c('diff_log_realgdp_pc'))
etable("CC Urban" = cc_urban, "CC Medium" = cc_medium, "CC Rural" = cc_rural, urban_2neg, medium_2neg, rural_2neg, order = c("mines_diff,1", "Change Active Mines"))
model_types <- list(
"Rural Type 1 Counties" = cc_rural,
"Medium Type 2 Counties" = cc_medium,
"Urban Type 3 Counties" = cc_urban)
test <- allcomp_cc_types %>%
group_by(fips) %>%
summarize(m1 = length(unique(mines_diff)), m1mean = mean(mines_diff),
m2 = length(unique(lag_diff)), m2mean = mean(lag_diff),
m3 = length(unique(lag_diff2)), m3mean = mean(lag_diff2))
test2 <- subset(test, (m1 == 1 & m1mean == 0) | (m2 == 1 & m2mean == 0) | (m3 == 1 & m3mean == 0))
const_fips <- unique(test2$fips)
allcomp_pdmif <- subset(allcomp_cc_types, !(fips %in% const_fips))
filter(allcomp_cc_types, fips %in% const_fips) %>%
group_by(fips) %>%
summarize(mean = mean(active_mines), max = max(active_mines), min = min(active_mines))
allcomp_pdmif %>%
group_by(fips) %>%
summarize(mean = mean(active_mines), max = max(active_mines), min = min(active_mines))
etable("REE Model Rural" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:REE_bin_top90 + lag_diff2:REE_bin_top90 + REE_bin_top90 + diff_log_realgdp_pc | fips + year, cc_ruraldf, se = 'twoway'),
"REE Model Medium" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:REE_bin_top90 + lag_diff2:REE_bin_top90 + REE_bin_top90 + diff_log_realgdp_pc | fips + year, cc_mediumdf, se = 'twoway'),
"REE Model Urban" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:REE_bin_top90 + lag_diff2:REE_bin_top90 + REE_bin_top90 + diff_log_realgdp_pc | fips + year, cc_urbandf, se = 'twoway'))
## Incorporating county types using PDMIF
# X can only have p columns where p = explanatory variables.
data4x <- select(allcomp_pdmif, c(mines_diff, lag_diff, lag_diff2, diff_log_realgdp_pc))
test <- as.matrix(data4x)
data4y <- select(allcomp_pdmif, c(year, fips, diff_uer))
yrs <- as.list(unique(data4y$year))
fps <- as.list(unique(data4y$fips))
data4y <- matrix(data = data4y$diff_uer, 18, 236, dimnames = list(yrs, fps))
groupmem <- allcomp_pdmif %>%
group_by(fips) %>%
summarize(type = unique(type))
groupmem <- data.frame(groupmem[,-1], row.names = groupmem$fips)
pdmif <- PDMIFLING(X = test, Y = data4y, Membership = groupmem, NGfactors = 1, NLfactors = c(2,2,2), Maxit = 30, tol = 0.01)
HYPTEST(pdmif$Coefficients,data.frame(c(0,1),c(-1,2)),pdmif$Se,"two",c(1,3),c(1,2))
dim(pdmif$Coefficients)
[1] 5 236
length(pdmif$GlobalFactors)
[1] 18
dim(pdmif$GlobalLoadings)
[1] 236 1
dim(pdmif$GroupFactors)
[1] 18 6
pdmif$GroupLoadings
[,1] [,2]
[1,] -1.7159587 -0.4970947242
[2,] -1.2506511 -0.1210225646
[3,] -1.3852535 0.0951779712
[4,] -1.6891283 -0.3700719870
[5,] -1.4116762 -0.2431827634
[6,] -1.5889026 -0.4369745256
[7,] -1.1397298 -0.1113813290
[8,] -1.7720693 -0.8481169382
[9,] -0.6990435 -0.1085787023
[10,] -1.1493175 -0.1049787054
[11,] -1.2850767 0.2441902281
[12,] -1.8289951 -0.0551859601
[13,] -1.4889412 -0.3418151961
[14,] -0.6844750 0.1285262330
[15,] -1.2232881 0.7003147640
[16,] -1.3245457 0.6977057578
[17,] -0.7053269 0.2276478006
[18,] -0.8012127 0.5346583256
[19,] -1.0619985 0.4226133227
[20,] -0.8184010 0.5107081237
[21,] -0.9289887 0.9545144094
[22,] -1.1570968 0.5137473310
[23,] -0.9022382 -0.1841984663
[24,] -0.8561709 0.0529724582
[25,] -0.8572588 0.0640358643
[26,] -0.6193238 0.1655374527
[27,] -0.9816035 0.1722331877
[28,] -0.9247881 0.0888869389
[29,] -1.0104618 -0.0160600749
[30,] -1.0653686 0.0623523863
[31,] -0.7243818 0.0205224419
[32,] -0.8214763 -0.1037216678
[33,] -0.9651488 0.3441734817
[34,] -0.7814670 0.1857697878
[35,] -0.9546420 0.3345663967
[36,] -1.2289414 0.1307069765
[37,] -1.1715969 -0.0506078405
[38,] -0.7134562 -0.0917209584
[39,] -0.7213129 0.0353784193
[40,] -0.6562196 0.1956879895
[41,] -1.1195242 -0.1118518538
[42,] -1.5049287 -0.3402423394
[43,] -0.5950205 -0.0524152399
[44,] -0.9564424 -0.2097201766
[45,] -0.8805123 -0.1802990870
[46,] -0.7781600 0.2327846675
[47,] -0.6106139 0.0233912923
[48,] -1.0577448 -0.3639123495
[49,] -1.2064187 -0.1095127000
[50,] -1.1068908 -0.3172667473
[51,] -0.9374111 -0.0133463758
[52,] -1.1961704 0.1398445108
[53,] -0.9696961 -0.0486858213
[54,] -0.6986131 0.3401840296
[55,] -0.8987623 -0.1034980341
[56,] -0.9251594 -0.3210185549
[57,] -1.1128281 0.2323201823
[58,] -0.9113787 0.3688966824
[59,] -1.3141056 0.5395957302
[60,] -1.0405316 -0.5282643749
[61,] -1.1888027 -0.5093174525
[62,] -0.9186122 1.0098312393
[63,] -1.0380936 -0.2482277838
[64,] -1.4471845 -0.5781267395
[65,] -1.1753829 -0.8862518737
[66,] -1.4872084 0.3061709516
[67,] -1.4529820 1.5516485033
[68,] -1.3093274 -0.3022461181
[69,] -0.8658539 0.0899705748
[70,] -0.8516251 -1.0527058808
[71,] -1.1340828 -0.0512920666
[72,] -1.7264298 0.2594457432
[73,] -1.2419140 -0.0519711858
[74,] -1.2411303 0.1354792515
[75,] -1.3259565 -0.3728491504
[76,] -1.4557448 0.0996240563
[77,] -1.7489861 0.7272107918
[78,] -1.8991391 1.2358124153
[79,] -1.1642256 0.3255957086
[80,] -1.1360085 -0.4995905667
[81,] -0.9777500 -0.0469936368
[82,] -3.2231074 -0.8893175141
[83,] -1.2205143 -0.3493537736
[84,] -1.0263532 0.4138303958
[85,] -0.9969444 -0.2351800257
[86,] -0.6030036 -0.3112774989
[87,] -1.3483443 0.1360292072
[88,] -1.0176361 0.0896070103
[89,] -1.1461173 0.4158326830
[90,] -1.3666393 0.1940533039
[91,] -0.9136789 -0.0002519597
[92,] -1.4476817 -0.8506894706
[93,] -1.3814870 -0.5980382220
[94,] -1.0589382 0.0833802672
[95,] -1.3031605 0.2013379285
[96,] -1.2928716 -0.3700868363
[97,] -0.8279977 0.0585134491
[98,] -0.8785844 -0.1431073276
[99,] -0.7823444 -0.0862205039
[100,] -0.8280243 0.0434538528
[101,] -1.0104990 -0.3956392895
[102,] -0.8944580 -0.0386228796
[103,] -0.9631695 -0.4234373064
[104,] -0.6130952 -0.2180252940
[105,] -0.8771488 0.5007586463
[106,] -0.9587444 0.4525580387
[107,] -0.3352550 -0.0399822978
[108,] -0.7878129 0.2681974845
[109,] -1.3692738 0.9954848539
[110,] -0.0388166 0.2325314582
[111,] -0.1619084 0.3432594547
[112,] -0.7494835 0.1539595032
[113,] -1.0347479 0.4739020803
[114,] -1.8120357 -0.0546686536
[115,] -1.6301879 -0.1424868413
[116,] -1.3106365 -0.1925992150
[117,] -0.7532339 0.6658529224
[118,] -1.4021690 0.2698509785
[119,] -1.6203980 0.4930464337
[120,] -1.1000921 0.2634289591
[121,] -1.4821608 0.4766755818
[122,] -0.8299076 0.5209184678
[123,] -1.3394871 -0.4322651178
[124,] -1.2797990 0.2210591342
[125,] -1.1508171 -0.0579231206
[126,] -1.6090337 -0.6913765937
[127,] -1.3921306 -0.1400417597
[128,] -1.2632700 0.2824218574
[129,] -1.5144344 -0.4241526262
[130,] -1.5008877 0.0276889948
[131,] -1.2386612 0.2194629341
[132,] -0.6138597 0.2479686786
[133,] -1.1809869 0.3918627056
[134,] -1.6450132 -0.3970821792
[135,] -1.0576647 -0.2042638377
[136,] -1.2260013 -0.1215535591
[137,] -1.1586916 -0.3999808763
[138,] -0.5857067 0.0586684273
[139,] -0.8277376 -0.1253250798
[140,] -0.6934433 0.0245373964
[141,] -1.0154204 -0.3166618409
[142,] -0.9516930 -0.1234327292
[143,] -0.5787977 0.0871874729
[144,] -0.6857673 -0.0865126044
[145,] -0.6726116 0.0908316511
[146,] -2.0236565 -1.4671095980
[147,] -0.8185153 0.1059080234
[148,] -0.4445917 -0.0390567038
[149,] -0.7707123 0.1322442020
[150,] -0.9103312 -0.0188514287
[151,] -0.7636032 0.1064530310
[152,] -0.6773481 0.0593553275
[153,] -1.4142426 -0.8555154621
[154,] -0.8215154 0.1441490675
[155,] -0.6624739 0.3986174726
[156,] -1.2639486 -0.4639307854
[157,] -0.6616146 0.1237445651
[158,] -0.9684697 0.0344129733
[159,] -0.7139272 0.0920895803
[160,] -0.7711334 -0.2856983587
[161,] -0.7738742 0.1430025575
[162,] -0.8066399 -0.1356472919
[163,] -0.9938972 -0.3934373704
[164,] -0.7655618 0.0535409956
[165,] -0.9513507 0.0590745474
[166,] -0.6140954 0.3044040558
[167,] -0.6521045 -0.3781353307
[168,] -0.6930063 -0.0201498550
[169,] -0.7507337 -0.1291831619
[170,] -0.6990263 -0.0612840621
[171,] -1.1002929 -0.2377199046
[172,] -1.3468597 -0.0484495258
[173,] -1.1441332 -0.2970481079
[174,] -0.7442754 -0.1115915965
[175,] -0.9590780 -0.2385965480
[176,] -0.8431418 -0.4488037712
[177,] -1.2421905 -0.2888702275
[178,] -2.1858810 -0.2374365836
[179,] -0.8111338 -0.0612775264
[180,] -1.0690627 0.2877466455
[181,] -0.6426882 0.4491948858
[182,] -0.8435226 0.2739970445
[183,] -1.0222202 0.5328307516
[184,] -0.5689554 0.4860229695
[185,] -1.1786594 0.3750612466
[186,] -1.5089804 0.0453876036
[187,] -1.1257778 0.4533350675
[188,] -1.0162773 0.1559590823
[189,] -0.8766348 0.3469732463
[190,] -0.9210683 -0.0344189592
[191,] -0.8644603 0.2006912723
[192,] -0.9583652 0.1162274757
[193,] -0.9119081 0.0924023410
[194,] -1.2247518 0.0927640938
[195,] -1.2078894 0.4021836572
[196,] -1.2895472 0.2569593215
[197,] -0.9936167 -0.0908636937
[198,] -0.6031454 0.1485510045
[199,] -0.9435497 -0.4717026699
[200,] -0.8502963 0.3166791492
[201,] -0.7801652 0.6673449513
[202,] -0.9853939 -0.0850541220
[203,] -1.1018199 0.1125817476
[204,] -1.1959980 0.2889242063
[205,] -1.0319688 -0.5079036935
[206,] -1.4556056 -0.1961404224
[207,] -1.1004810 0.2789980436
[208,] -1.4615248 -0.1154133489
[209,] -1.1468907 -0.3616324474
[210,] -0.5556949 0.1523339070
[211,] -0.8472345 0.1424326726
[212,] -1.4460356 -0.2866694135
[213,] -1.4032476 0.3269551179
[214,] -1.4665441 0.0575400029
[215,] -0.7552432 0.1326445954
[216,] -1.1412369 0.1002969852
[217,] -1.1462284 -0.5101252567
[218,] -0.6988479 0.4242532034
[219,] -0.6276576 0.2000978373
[220,] -1.5269998 0.5727156333
[221,] -0.4989364 0.2012265103
[222,] -1.1288666 0.3383150708
[223,] -1.0414479 -0.0198865100
[224,] -0.9138263 0.2040288935
[225,] -0.8895445 0.2033318353
[226,] -1.0154902 0.0445392741
[227,] -0.7431987 -0.0300771678
[228,] -1.3694650 -0.3693082574
[229,] -1.2409798 0.0174563608
[230,] -0.7850017 -0.3177054613
[231,] -1.2863975 -0.1015976608
[232,] -1.2722144 0.1618367362
[233,] -0.7796648 0.6137700202
[234,] -0.8196192 -0.0269958812
[235,] -0.6506832 -0.0254960712
[236,] -1.1407800 0.2121138127
pdmif$Coefficients
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.096982562 0.01581241 0.004484555 -0.06428478 -0.06457646 -0.08994161
[2,] 0.197465619 0.30025959 0.227363599 1.33537524 0.21310697 -0.22952988
[3,] 0.172749716 -0.30190028 -0.249475015 -0.69659703 -0.22768456 -0.21320294
[4,] -0.006667603 0.21835560 0.019699628 0.70605687 -0.31344583 -0.15774282
[5,] 2.182062635 -4.56205117 -4.047812105 1.79568525 -10.40618262 2.03012763
[,7] [,8] [,9] [,10] [,11]
[1,] -0.02181789 -0.081344811 -0.003662305 -0.002339964 0.01698375
[2,] 0.02865299 -0.070730460 0.038953983 0.108925737 0.06218569
[3,] -0.05895855 -0.073898643 0.090026729 -0.093408741 0.07307387
[4,] -0.03622374 0.005365252 0.019108257 0.007243005 0.20864046
[5,] -7.20190818 -10.564478500 -2.982206286 -5.797698275 0.26856310
[,12] [,13] [,14] [,15] [,16] [,17]
[1,] -0.06946269 0.2736765 -0.02650192 0.09578466 0.1671813 0.05739564
[2,] 0.25444949 0.4319853 -0.22007833 0.26171014 0.9196682 0.41131088
[3,] 0.14770195 0.1921369 0.06219956 0.27846391 1.1409913 0.55349628
[4,] 0.03639913 0.8905720 -0.12118612 0.20868257 0.1441628 0.22540192
[5,] -14.76172692 4.4866371 0.47327009 3.50735950 -1.5298982 2.56084962
[,18] [,19] [,20] [,21] [,22] [,23]
[1,] -0.01006053 0.08058213 0.04826516 0.08065891 -0.0162683 -0.14131251
[2,] 0.08807713 0.97734272 -0.54663873 -0.97985679 -0.4098898 0.24164917
[3,] 0.36865175 0.60083092 -0.77282524 1.27618545 -0.6794463 -0.18584679
[4,] -0.10594479 0.10478270 -1.21436544 -0.17241829 -0.2895050 -0.07518825
[5,] 1.61954547 -0.81071145 9.88293037 -0.76202989 2.5481309 2.83861093
[,24] [,25] [,26] [,27] [,28] [,29]
[1,] -0.15414001 -0.05924989 -0.02234328 0.05366529 0.02330964 0.01221998
[2,] -0.26170549 0.21903772 0.01189194 0.17607641 -0.02150335 0.03520131
[3,] -0.27274221 0.17238788 -0.14485380 0.52125554 -0.33983255 0.19381123
[4,] 0.02457872 0.50605188 0.10360397 0.02237312 -0.05411052 0.35329195
[5,] 0.01616854 -1.88601065 0.67539368 -2.49402425 0.23559612 -0.02245021
[,30] [,31] [,32] [,33] [,34]
[1,] -0.0004730148 -0.26539764 -0.08317794 0.255725446 -0.058979386
[2,] 0.2256763268 0.37463744 0.19408261 -1.204356655 -0.073207107
[3,] 0.4911442403 0.23435054 0.09879181 0.002251206 0.085974585
[4,] -0.3814220432 -0.08001124 0.17177832 -0.216500464 0.004286006
[5,] 0.9189050771 5.21686311 1.16566527 -13.989112741 -3.092112071
[,35] [,36] [,37] [,38] [,39] [,40]
[1,] 0.02679171 -0.04735554 0.047528989 0.03388928 0.06012161 0.07380386
[2,] -0.30356459 0.48428172 -0.288251610 -0.17238088 0.61863618 1.01851730
[3,] -0.05542970 -0.06576641 -0.008205903 -0.18036256 0.17531779 0.80048092
[4,] -0.08408217 -0.18820315 0.784565453 -0.35676218 0.20427453 -0.24302747
[5,] -1.71264237 5.28990585 -5.368725005 -1.30443643 -1.91839278 -10.36830759
[,41] [,42] [,43] [,44] [,45] [,46]
[1,] 0.05486592 -0.004812446 0.02255845 0.1257899 0.02590248 -0.05781669
[2,] -0.16888020 1.038690762 -0.14707298 -0.1704850 0.09585739 -0.04681770
[3,] -0.04950102 0.579149302 0.27543141 -0.5388249 -0.03245686 -0.33855662
[4,] -0.02419832 0.095800189 -0.05508256 -0.2047222 0.06645682 -0.05052562
[5,] -5.30024751 7.625513073 -3.98635533 -0.3319122 -1.33337337 -15.47592044
[,47] [,48] [,49] [,50] [,51] [,52]
[1,] 0.16823945 0.05076861 0.03480997 0.008035774 0.005329545 0.02799855
[2,] 0.12547798 0.21467980 0.05511653 -0.420334851 -0.051188257 0.25887719
[3,] 0.11870738 -0.50120535 -0.02357010 0.387814964 0.125472161 -0.32203824
[4,] 0.09252739 0.30568229 -0.03501199 0.600839087 -0.024838210 0.30432651
[5,] -2.70744757 -7.27907964 -0.81537356 1.396613784 -1.032064699 6.03268902
[,53] [,54] [,55] [,56] [,57] [,58]
[1,] 0.01649458 0.1262815 -0.1585307 -0.04726732 -0.066360533 0.026753366
[2,] -0.12230329 1.1310019 -0.6686103 -0.53890628 0.031827191 -0.046671214
[3,] -0.04688764 -0.2449663 -0.3153409 -0.66869923 0.006044049 -0.015525322
[4,] -0.05392878 -0.3854056 -0.9750561 -0.53891770 0.023069906 0.006144232
[5,] -0.94780197 -5.6094866 2.9031573 2.00279683 -1.237507227 -2.568585103
[,59] [,60] [,61] [,62] [,63] [,64]
[1,] -0.08089451 0.01003462 -0.05021103 -0.3524449 -0.10280067 0.08269093
[2,] 0.15525546 -0.35428176 -0.09872282 0.1373106 -0.02866929 -0.07166053
[3,] -0.20146837 -0.11694346 -0.14053547 0.3113057 0.19743770 -0.40084555
[4,] -0.08908985 -0.12361437 0.24248088 -0.1100309 0.20696844 -0.20537025
[5,] -2.83827646 -10.72506073 3.17868703 26.8521888 2.62343450 -4.15775394
[,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.04138939 -0.040064574 -0.0007362193 0.05161787 0.09185479 -0.07073663
[2,] 0.03165022 -0.023723173 -0.0414842779 -0.05575432 0.04164251 0.91740433
[3,] 0.07898768 -0.039863476 0.0033408349 0.09038758 0.01133390 -0.88218300
[4,] -0.20888030 0.006748412 -0.0584372685 0.13358913 0.18186504 -0.35438516
[5,] -0.09798309 -3.505200456 6.3041616440 1.39282541 0.46060327 -6.37977198
[,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.00997169 -0.44474303 -0.06120406 0.004393256 -0.05562603 -0.009599279
[2,] 0.07090067 0.12876794 0.01357226 -0.043425860 0.05506003 -0.151828300
[3,] 0.12864136 0.02028597 -0.14933141 -0.085244679 -0.02742979 0.179285839
[4,] 0.13565822 -0.07601688 -0.12735312 -0.075753270 0.08259904 0.363735817
[5,] -4.55281363 -8.60120001 0.44876409 7.066741054 -3.19862697 -8.143945254
[,77] [,78] [,79] [,80] [,81] [,82]
[1,] -0.07478471 -0.31110067 0.02679439 -0.17408152 -0.11759396 0.1758414
[2,] -0.14236384 -0.12873642 -0.03188960 0.14231290 0.14274313 0.1609918
[3,] 0.01343117 -0.04619204 -0.17126568 0.04422442 0.49233181 -0.4833354
[4,] -0.11156192 -0.10543498 0.02846461 0.09502682 -0.04951795 -0.3072073
[5,] -0.79301670 4.90987334 0.48688155 -19.05940948 2.25466545 -8.2848005
[,83] [,84] [,85] [,86] [,87] [,88]
[1,] -0.05378226 0.01620354 -0.05835848 -0.06733417 -0.04310416 0.1353579
[2,] -0.16883827 -0.10898358 -0.20663313 -0.09900863 -0.13248355 0.8489578
[3,] -0.12120503 -0.04386876 0.36633905 0.20218117 -0.13989494 0.3186798
[4,] 0.18758772 -0.08590368 0.44227925 -0.06613681 0.18255571 0.3542420
[5,] 4.59627534 6.03977904 -10.51526629 0.42443243 2.72109764 -0.3581265
[,89] [,90] [,91] [,92] [,93] [,94]
[1,] -0.12388657 -3.001223e-01 0.03336805 0.0105249 -0.04009129 0.11849503
[2,] -0.01879418 -6.328088e-03 -0.05839125 0.5710398 -0.40738926 -0.08219293
[3,] 0.12457682 -2.890082e-02 0.60045376 0.3187342 -0.11998687 0.01297986
[4,] 0.09071514 -2.949175e-04 0.09038809 0.2036538 0.14067389 0.26486812
[5,] -16.39914252 -1.165707e+01 -12.94456049 0.4784692 2.21596102 1.63323584
[,95] [,96] [,97] [,98] [,99] [,100]
[1,] 0.03707146 -0.06795651 0.01399092 0.02933869 -0.05933928 -0.02022425
[2,] 0.03013566 0.35827961 0.12411900 0.66830914 -0.08208146 0.05506468
[3,] 0.04984559 0.37199214 0.59768066 0.94038550 -0.01101590 0.11825172
[4,] -0.13445471 0.18693061 0.80310676 0.04897772 0.09738021 0.06315884
[5,] -1.02482065 8.73490708 -4.92379620 -0.38027307 2.05294513 0.64650161
[,101] [,102] [,103] [,104] [,105] [,106]
[1,] 0.2386085 0.05205552 -0.08927244 -0.09035823 -0.6063005 0.2298775
[2,] 0.3512321 0.94203704 1.35603668 -0.47120933 0.7948743 -1.0406764
[3,] -0.5142977 0.75232868 0.97568584 0.26150542 7.1915943 0.5990978
[4,] -3.1800315 0.49314140 0.17383601 1.05909645 -2.5465934 -0.3629324
[5,] 0.1366017 2.17928800 4.40436091 4.83157904 2.4416556 -3.0631209
[,107] [,108] [,109] [,110] [,111] [,112]
[1,] -0.01894389 0.04674641 0.4084721 0.06068036 0.01546495 0.1322148
[2,] 0.48719139 -0.27997529 0.8526412 0.25212819 -0.12841575 0.7995035
[3,] 0.23205027 -0.40707330 -1.3105204 -0.42616656 0.47401271 0.8835799
[4,] -0.54871361 -0.18851428 1.9789427 -0.31708970 0.22001569 0.3986271
[5,] -0.37742837 -1.33643490 5.2969272 -3.10163529 -1.55295033 1.2928041
[,113] [,114] [,115] [,116] [,117] [,118]
[1,] 0.007662545 0.09988463 0.145840484 0.1024545 -0.11769112 -0.2001175
[2,] 0.170247539 -0.19363359 0.009969699 0.1144225 -0.06334574 -0.2342516
[3,] 0.014844646 -0.23028030 0.006850185 0.2824710 -0.16104318 -0.4194008
[4,] 0.031485341 -0.10473602 -0.011398193 -0.3097834 -0.50777673 -0.3470900
[5,] 1.599348819 -0.18846228 -5.712934722 -0.8189174 1.87101648 2.9212712
[,119] [,120] [,121] [,122] [,123] [,124]
[1,] 0.09471807 0.1130413 -0.05158016 -0.009255558 0.05268428 -0.08885085
[2,] 0.04457850 0.1374791 -0.27943896 0.024513231 -0.37646922 0.52281397
[3,] 0.17052701 0.4886746 -0.01194357 0.306694132 0.26451682 -0.34081443
[4,] 0.16504237 0.4869065 0.08805378 0.173056241 0.04452961 -0.18800133
[5,] 0.93891937 12.0179440 1.19955003 -0.255919197 -1.29144575 -4.97489791
[,125] [,126] [,127] [,128] [,129] [,130]
[1,] 0.03804128 0.21738263 0.1071019 0.02677213 -0.01188676 0.066718293
[2,] 0.23958559 -0.22956649 -0.1293724 -0.24703287 0.08459353 -0.002949392
[3,] -0.04262501 0.33190291 -0.3037319 0.60787171 0.06680361 -0.149810314
[4,] 0.27506057 -0.06004528 -0.1322323 0.67148435 -0.13527336 -0.096535510
[5,] 0.78227919 -0.94998283 -1.9285334 0.12200297 10.11875057 -0.968574513
[,131] [,132] [,133] [,134] [,135] [,136]
[1,] -0.05970780 -0.008679655 0.1547308 0.1383191 0.07527548 0.05962843
[2,] -0.09551346 -0.420906283 0.2106165 -1.0239744 0.16017900 0.66933660
[3,] -0.49052630 -0.150718682 -0.1388989 -0.2749802 -0.16530208 0.22464733
[4,] -0.41004632 0.291334314 0.7380737 -0.2903714 -0.21571934 -0.30891216
[5,] 0.71453901 0.569753533 -0.7002368 -2.6078108 -4.82277191 -1.37762919
[,137] [,138] [,139] [,140] [,141] [,142]
[1,] -0.01165637 0.06965512 -0.042529040 0.08605934 -0.01552663 0.03694875
[2,] -0.57470776 -0.01403147 -0.013985063 0.08620651 -0.37494971 0.14811760
[3,] -0.42129025 -0.07782227 -0.042994896 -0.14772821 -0.31825185 0.02242545
[4,] 0.03739733 0.00151354 -0.005750002 0.48732787 -0.06674310 -0.07326151
[5,] -0.34237267 -3.92207868 -7.110402730 -3.75340719 -3.56643887 -1.96886343
[,143] [,144] [,145] [,146] [,147] [,148]
[1,] -0.04031168 0.025608024 -0.01879067 -0.03306192 0.2537349 0.01857710
[2,] -0.06785872 -0.062509632 -0.01184425 -0.58335893 -0.2399527 0.01411565
[3,] 0.20069865 -0.127112728 -0.03356285 0.06986585 0.0452182 -0.07679947
[4,] 0.03168676 -0.006763502 -0.03305051 -0.73993021 -0.1785329 0.07117203
[5,] 0.57366402 -2.786992939 -3.72751580 3.76911264 -6.5063331 -1.88105845
[,149] [,150] [,151] [,152] [,153] [,154]
[1,] 0.103288784 0.022415911 0.03168142 0.07722191 0.07125857 0.08089592
[2,] 0.144653288 -0.003688951 0.20771394 0.03263149 0.06165718 0.02033496
[3,] 0.106305882 -0.011417365 0.01883047 0.07323220 -0.31521121 -0.01422248
[4,] -0.008329157 0.026040163 0.05001719 0.02261850 -0.08361253 -0.03256338
[5,] 2.585865541 -5.170108284 -1.60617720 -6.39940681 -7.50624108 -2.01246105
[,155] [,156] [,157] [,158] [,159] [,160]
[1,] 0.09829196 0.1120383 0.091290307 0.11584785 0.15764644 0.02517606
[2,] 0.15838546 -0.4125595 -0.026018234 0.03424830 0.18379288 0.02039404
[3,] 0.14990208 -1.6818112 0.003842039 -0.01609933 0.05421102 -0.24829109
[4,] -0.02853252 -0.3736089 0.039053891 0.02482566 0.09809183 -0.14755343
[5,] 1.43300021 -8.2081280 -8.955649844 -6.22857706 -9.40233016 -4.00437874
[,161] [,162] [,163] [,164] [,165]
[1,] 0.030454374 0.005229061 0.14745007 0.06826318 -0.005805539
[2,] -0.034187071 -0.170814405 -0.09127425 -0.03413098 0.034419469
[3,] 0.005258870 0.226947409 -0.03092286 0.01923485 -0.021717756
[4,] 0.001160607 -0.198636368 0.60271704 -0.05754995 0.007596287
[5,] 0.163229289 -0.299694850 -11.89731729 -4.64257574 0.779832228
[,166] [,167] [,168] [,169] [,170]
[1,] 0.04305948 0.05340929 0.23011376 -0.0006804426 0.024599592
[2,] -0.02656849 -0.27494235 -0.04759019 0.0119855193 0.041713900
[3,] 0.02873286 -0.37771992 -0.04486729 0.0111473342 0.041408673
[4,] 0.01167391 0.55365161 0.22687168 0.1430393930 0.001833882
[5,] -3.18951782 -1.15056954 -10.93917339 1.7823512228 -0.268490212
[,171] [,172] [,173] [,174] [,175] [,176]
[1,] -0.01433290 0.02722652 0.026018594 -0.09934272 -0.04866599 -0.0804885
[2,] -0.00161266 -0.01287118 -0.010345933 0.07956391 -0.07163641 0.2563591
[3,] -0.11609602 0.10949330 0.008685134 0.04021899 -0.67532141 0.1425894
[4,] 0.01295005 -0.05548110 0.027056853 -0.42749782 -0.70123030 0.1011791
[5,] 1.51800661 -1.87346831 -1.932688275 -15.32003517 2.37656032 -5.8987341
[,177] [,178] [,179] [,180] [,181] [,182]
[1,] -0.03122580 0.3923741 -0.1522263 0.01387516 -0.04405376 -0.020319441
[2,] 0.01361661 0.9821501 -0.3937627 -0.21976745 -0.06822359 0.084539462
[3,] 0.03919566 1.4052051 -0.5267384 -0.05348111 -0.37173787 0.006197581
[4,] 0.03087236 0.9716418 -0.5687771 0.40719210 -0.18853887 -0.363755051
[5,] 3.04435227 3.9230023 8.5395895 -0.74270325 -2.81876794 -0.003129918
[,183] [,184] [,185] [,186] [,187] [,188]
[1,] 0.04619226 -0.1865192 -0.461636 0.13308434 -0.03406584 -0.02260939
[2,] -0.51678067 0.5551459 -1.788954 0.49227251 0.09035485 -0.29597839
[3,] 1.07994558 0.3002365 -0.917324 0.09556089 0.13648932 0.36976100
[4,] 0.09483695 1.4762739 1.345954 0.43609562 -0.07120954 0.59247577
[5,] -2.86686034 4.1966943 2.142175 -1.76829156 -2.05535476 0.54339201
[,189] [,190] [,191] [,192] [,193] [,194]
[1,] 0.03122854 -0.05005939 -0.21843531 -0.09410384 0.04851126 0.003455175
[2,] 0.09364822 0.24701336 -0.16958618 -0.28769290 -0.50790839 0.195415145
[3,] -0.12282667 0.15036440 -0.34322516 -0.11919454 -0.29420326 -0.327377399
[4,] -0.05232798 0.55722339 -0.01191703 -0.15314465 0.10907216 0.092834363
[5,] 0.72379235 0.77114667 -2.18304379 6.69544516 -4.12215391 -1.025667995
[,195] [,196] [,197] [,198] [,199] [,200]
[1,] -0.06553308 0.001052558 -0.1783757 -0.09914535 -0.11344582 0.09479269
[2,] -0.04942156 0.192670217 0.6668382 0.02465177 -0.09297970 0.07515087
[3,] 0.01866546 -0.021396719 -0.9919839 -0.06624163 0.02476508 0.24304835
[4,] 0.01921058 0.083577423 -0.1132233 -0.03609172 0.06380090 0.18032682
[5,] 0.78069034 4.181157589 -4.9790268 -5.52603167 -1.49663837 -2.55352198
[,201] [,202] [,203] [,204] [,205] [,206]
[1,] -0.23383860 -0.08993935 -0.05993417 -0.01132878 0.009603434 -0.04660046
[2,] -0.05352490 -0.37256976 -0.08395470 -0.06733110 -0.905494988 0.44256870
[3,] -0.05744818 0.29008171 -0.03240443 0.02463175 -0.508675265 -0.22027262
[4,] 0.03895087 -0.31798822 -0.04079500 0.09364354 -0.281167498 -0.01026686
[5,] -4.05114094 -1.75970256 1.51860242 -1.52069610 -2.749919607 -3.10761530
[,207] [,208] [,209] [,210] [,211]
[1,] 0.008667404 -0.0135401407 0.014991068 0.136467214 -0.03475386
[2,] 0.009593630 -0.1420236387 -0.028553409 -0.077035437 -0.03368546
[3,] 0.020383986 0.0862902856 0.001600125 -0.001161309 -0.01639970
[4,] 0.005385690 0.0007758484 -0.110692667 0.063182033 -0.03830633
[5,] -3.885254934 -8.4181194341 5.158298683 -7.585506969 3.47245716
[,212] [,213] [,214] [,215] [,216] [,217]
[1,] 0.02379568 0.045754575 0.24346661 -0.015137347 0.005054379 -0.03501973
[2,] 0.02533997 -0.049119222 -0.01021564 -0.002576104 0.479876185 0.18987603
[3,] 0.10755924 -0.015368213 0.01410280 0.136949227 0.409634977 0.07311577
[4,] 0.15515433 -0.009572094 0.01893432 0.106960420 0.152328003 -0.60689483
[5,] -2.53872862 2.273429923 -6.75561203 0.214976970 -0.538449480 -0.65777756
[,218] [,219] [,220] [,221] [,222] [,223]
[1,] 0.065648204 -0.1918557 -0.21659644 0.003055776 -3.324569e-02 0.02461426
[2,] 0.030439292 0.1864587 -0.05243454 0.005622446 2.245024e-02 -0.32168639
[3,] -0.223453365 -0.2115671 -0.02222156 -0.016492777 6.862687e-02 -0.05545155
[4,] -0.008801991 0.4984232 -0.00180395 0.009798886 -7.259226e-05 -0.17057227
[5,] 5.200989279 11.4083582 -2.92561814 -0.441753706 -8.879111e+00 1.30340705
[,224] [,225] [,226] [,227] [,228] [,229]
[1,] -0.023447425 0.06909338 0.01221833 -0.01617890 0.02310460 0.08393972
[2,] -0.049410108 -0.05104247 -0.07474333 0.18036787 -0.55319830 0.03658127
[3,] -0.001090005 0.04073767 0.04136036 -0.08507372 -0.03256302 -0.02898953
[4,] -0.001678141 0.04702490 0.48409685 -0.30419452 -0.07260835 -0.01925247
[5,] -0.808465184 -8.12743593 7.31249862 0.96245455 1.02702105 1.59113124
[,230] [,231] [,232] [,233] [,234] [,235]
[1,] -0.01043464 -0.03076702 0.01173849 -0.01687044 0.1244041 0.03147853
[2,] -0.05502378 0.05218179 -0.01851073 0.21213952 0.2935620 0.07140946
[3,] -0.08483239 0.14123632 -0.01835034 0.48316900 0.1433885 0.10180752
[4,] 0.08239944 0.06178442 0.04861970 0.08404696 0.1214794 -0.20546807
[5,] -1.31936476 -2.72085419 -7.21414723 -8.89966924 -1.6397756 -0.81081307
[,236]
[1,] 0.14678850
[2,] -0.19798863
[3,] -0.09435322
[4,] -0.20361795
[5,] 6.60407797
colnames(pdmif$Coefficients) <- colnames(data4y)
length(pdmif$Coefficients[1,which(groupmem$type == 3)])
[1] 41
length(pdmif$Coefficients[1,which(groupmem$type == 2)])
[1] 148
length(pdmif$Coefficients[1,which(groupmem$type == 1)])
[1] 47
pdmif$Coefficients[which(groupmem$type == 3)]
[1] -0.093408741 0.254449488 0.036399129 -14.761726920 0.431985299
[6] 0.890572009 4.486637086 -0.026501919 -0.220078329 0.473270089
[11] 0.095784655 0.261710143 0.278463911 3.507359505 0.167181286
[16] 0.919668180 1.140991268 -1.529898214 0.411310883 0.225401921
[21] 2.560849620 0.368651748 1.619545472 0.048265165 0.080658910
[26] -0.022343283 -0.047355537 -1.918392782 0.073803858 0.800480917
[31] -0.243027467 -0.024198318 -0.004812446 -0.147072977 0.275431405
[36] -0.055082556 -0.170484972 -0.331912185 -15.475920442 0.168239445
[41] 0.125477978
# pdmifshort <- pdmif$Coefficients[,colnames(pdmif$Coefficients)!="30003"]
# groupmemshort <- as.data.frame(groupmem[rownames(groupmem) != "30003",])
# names(groupmemshort) <- "type"
beeswarm(c(pdmif$Coefficients[1,],pdmif$Coefficients[2,],pdmif$Coefficients[3,]) ~ c(rep(1,236),rep(2,236), rep(3,236)),
#col = c(rgb(0.25, 0.63, 1, 0.75), rgb(1, 0.88, 0.6, 0.75), rgb(0.97, 0.43, 0.37, 0.75)),
pwcol = c(rep(groupmem$type), rep(groupmem$type),rep(groupmem$type)),
pch=19, method="swarm", cex=0.5, corral="wrap", ylab="Value", xlab=NA, labels=c("mines_diff","lag_diff","lag_diff2"))
legend("topright", legend = c("1", "2", "3"),
col = 1:3, pch = 19)
# allcomp %>% filter(fips == "30003") %>% ggplot(aes(y = uer, x = year))+
# geom_line()+
# geom_line(aes(y = mines_diff))
allcomp_cc_typespdmif <- subset(allcomp_cc_types, fips %in% allcomp_pdmif$fips)
urban_pdmif <- allcomp_cc_typespdmif %>% subset(type == 1)
medium_pdmif <- allcomp_cc_typespdmif %>% subset(type == 2)
rural_pdmif <- allcomp_cc_typespdmif %>% subset(type == 3)
cc_ruralpdmif = feols(FE_diffuer, rural_pdmif, se = "twoway")
cc_mediumpdmif = feols(FE_diffuer, medium_pdmif, se = "twoway")
cc_urbanpdmif = feols(FE_diffuer, urban_pdmif, se = "twoway")
etable(cc_rural, cc_ruralpdmif, cc_medium, cc_mediumpdmif, cc_urban, cc_urbanpdmif)
Likely to exclude this estimation as results are not significant.
# ----- on binary indicator for whether the change in mines is negative from the previous year
allcomp$lag_closure2[which(is.na(allcomp$lag_closure2))] <- 0
allcomp_cc$lag_closure2[which(is.na(allcomp_cc$lag_closure2))] <- 0
etable("Model 10" = feols(diff_uer ~ mine_closure + lag_closure + lag_closure2 + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'), "Model 11" = feols(diff_uer ~ mine_closure + lag_closure + lag_closure2 + mine_closure:ruc_bin +
lag_closure:ruc_bin + lag_closure2:ruc_bin + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway'), "Model 10 CC" = feols(diff_uer ~ mine_closure + lag_closure + lag_closure2 + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'),"Model 11 CC" = feols(diff_uer ~ mine_closure + lag_closure + lag_closure2 + mine_closure:ruc_bin +
lag_closure:ruc_bin + lag_closure2:ruc_bin + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'))
Likely to exclude this estimation as results are not significant.
Coefficient interpretation….mines_diff impact on CHANGE in UER and CHANGE in LOG of emp, unemp, lf, and pop. Does this mean that the coefficient on mines_diff translates to “a one-unit increase in mines is correlated with a x% increase in the CHANGE in log of emp, unemp, lf and pop.”
Isn’t the question we want to answer the impact of mines_diff on the log of emp, unemp, lf, pop? Or are we comparing the change in the CHANGE in log of emp, etc compared to mean change?
model_uer <- feols(FE_diffuer, allcomp, se = 'twoway')
model_emp <- feols(diff_log_employed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop | fips + year, allcomp, se = 'twoway')
model_unemp <- feols(diff_log_unemployed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop | fips + year, allcomp, se = 'twoway')
model_lf <- feols(diff_log_lf ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop |
fips + year, allcomp, se = 'twoway')
model_pop <- feols(diff_log_pop ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp |
fips + year, allcomp, se = 'twoway')
model_uercc <- feols(FE_diffuer, allcomp_cc, se = 'twoway')
model_empcc <- feols(diff_log_employed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop | fips + year, allcomp_cc, se = 'twoway')
model_unempcc <- feols(diff_log_unemployed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop | fips + year, allcomp_cc, se = 'twoway')
model_lfcc <- feols(diff_log_lf ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop |
fips + year, allcomp_cc, se = 'twoway')
model_popcc <- feols(diff_log_pop ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp |
fips + year, allcomp_cc, se = 'twoway')
etable("Model 1"= model_uer,
"Model 2" = model_emp,
"Model 3" = model_unemp,
"Model 4" = model_lf,
"Model 5" = model_pop)
# Performs same regressions on subset of coal counties only (defined as counties
# that have had active mines between 2002-2019).
etable("Model 1 CC"= model_uercc,
"Model 2 CC" = model_empcc,
"Model 3 CC" = model_unempcc,
"Model 4 CC" = model_lfcc,
"Model 5 CC" = model_popcc)
model_list = list(model_uer, model_emp, model_unemp, model_lf, model_pop)
var_rows <- c("Dependent Var.:", "Change Active Mines","Change Active Mines (t-1)","Change Active Mines (t-2)")
# econ_df <- data.frame(matrix(nrow = 4))
# for(k in 1:length(model_list)){
# model = etable(model_list[k])
# save_short <- subset(model, rownames(model) %in% var_rows)
# econ_df <- cbind(econ_df, save_short)
# }
# econ_df
# test <- as.matrix(pvalue(model_emp)[1:3])
econ_df <- as.data.frame(rbind(create_cols(model_uer), create_cols(model_emp), create_cols(model_unemp), create_cols(model_lf), create_cols(model_pop)))
colnames(econ_df) <- c("t", "t-1", "t-2")
econ_df$model <- c("UER", "EMP", "UNEMP", "LF", "POP")
econ_dflong <- pivot_longer(econ_df, !model, names_to = "time", values_to = "fill")
#econ_dflong$fill <- as.factor(econ_dflong$fill)
econ_dflong$fill[which(econ_dflong$fill == 0)] <- NA
# writexl::write_xlsx(econ_dflong, here("data/"fulleconomydf.xlsx"))
ggplot(econ_dflong, aes(x = time, y = model, fill = fill))+
scale_y_discrete(limits = rev(c("UER", "EMP", "UNEMP", "LF", "POP")), labels = rev(c("Model 1: \u0394 UER","Model 2: \u0394 (log) Employed persons", "Model 3: \u0394 (log) Unemployed persons", "Model 4: \u0394 (log) Labour force", "Model 5: \u0394 (log) Population")))+
scale_x_discrete(limits = c("t", "t-1", "t-2"), labels = c("0","+1", "+2"))+
geom_tile(color = "white",
lwd = 1.5,
linetype = 1)+
scale_fill_gradientn(colours=c("navy","royalblue","lightskyblue","white", "mistyrose","red", "darkred"),limits = c(-4,4), na.value = "grey98", labels = c("(-)***","(-)**", "(+/-)*", "(+)**","(+)***"),labs(colour="Sign and Significance Level", size = 0.1))+
ylab("Outcome Variable")+
xlab("# years following mine closure")+
theme(panel.background = element_blank(), panel.border = element_blank(), legend.title=element_text(size=8), )
Research Question: Do proximate renewable energy investments impact county-level employment impacts of mine closures?
Employs standard two-way fixed effects panel regressions with county-clustered standard errors to a panel dataset of 3,072 contiguous counties observed between 2002-2019. Interacts binary indicator for whether the total number of active mines in a county decreased from the previous year and whether REE investments exceeded 0.1% of county GDP.
Results: 1. No statistically significant impact of renewable energy investments detected.
summary(allcomp$REE_inv_scaled_realgdp[allcomp$REE_inv_scaled_realgdp != 0])
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.0049 0.0221 0.6541 0.0982 503.9275
#7728 observations of non-zero REE. 13.9% of observations have non-zero REE
# 460 observations have investment >= 1*county real GDP (8 also with active mines)
# 75 observations have investment >= 10*county real GDP
# 6 observations have investment >= 100*county real GDP
# 1st quartile upper limit is 0.0049* county real GDP
### 465 observations in coal subset with 162 with mines_diff != 0
test <- subset(allcomp, REE_inv_scaled_realgdp != 0)
quantile(test$REE_inv_scaled_realgdp, probs = seq(.1, .9))
10%
0.00115976
summary(test$REE_inv_scaled_realgdp)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.0049 0.0221 0.6541 0.0982 503.9275
hist(test$REE_inv_scaled_realgdp[test$REE_inv_scaled_realgdp < 1], breaks = 100)
##### Preferable to use indicator for whether ANY REE as only 162 observations?
##### (of 7728 with REE investments) have non-zero mines_diff
## Went with top 10th percentile of data (7020 observations 152 with non-zero mines_diff)
etable("REE Model" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:l(REE_bin_top90,1) + lag_diff2:l(REE_bin_top90,2) + REE_bin_top90 + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year, se = 'twoway'),
"REE Model CC" = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:REE_bin_top90 + lag_diff2:REE_bin_top90 + REE_bin_top90 + diff_log_realgdp_pc | fips + year, allcomp_cc, se = 'twoway'), signifCode = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1))
ree_model_main = feols(diff_uer ~ mines_diff + lag_diff + lag_diff2 + mines_diff:REE_bin_top90 +
lag_diff:REE_bin_top90 + lag_diff2:REE_bin_top90 + REE_bin_top90 + diff_log_realgdp_pc | fips + year, allcomp, se = 'twoway')
etable(feols(diff_uer ~ mines_diff + mines_diff:REE_bin_top90 + mines_diff:l(REE_bin_top90, 1) + mines_diff:l(REE_bin_top90, 2) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ mines_diff + mines_diff:REE_bin_top90 + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ mines_diff + mines_diff:l(REE_bin_top90, 1) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ mines_diff + mines_diff:l(REE_bin_top90, 2) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'))
etable(feols(diff_uer ~ lag_diff2 + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ lag_diff2 + lag_diff2:l(REE_bin_top90, 1) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ lag_diff2 + lag_diff2:l(REE_bin_top90, 2) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'),
feols(diff_uer ~ lag_diff2 + lag_diff2:l(REE_bin_top90, 2) + lag_diff2:l(REE_bin_top90, 1) + diff_log_realgdp_pc | fips + year, allcomp, panel.id = ~fips+year,se = 'twoway'), signifCode = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1))
Cross-sectional dependence detected. Moran’s I test and lagrange multiplier tests remain to be run!
##############################################################
# library(lmtest)
# mainplm <- plm(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc, allcomp_full, effect="twoways", index = c("fips","year"))
# Confirms fixed effects is the way to go
phtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, effect = "twoways", index = c("fips", "year"),
test = c("cd", "sclm", "bcsclm", "lm", "rho", "absrho"),
w = fmat)
# Confirms presence of cross sectional dependence
tests <- c("cd", "lm", "sclm", "rho", "absrho")
cdtest <- lapply(tests,function(x) pcdtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, effect = "twoways", index = c("fips", "year"),
test = x,
w = fmat))
pcdtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, effect = "twoways", index = c("fips", "year"),
test = "rho",
w = fmat)
# Randomization-based test of spatial dependence for panel models
# All of the following confirm cross-sectional dependence robust to global
# dependence by common factors and persistence (serial correlation) in the data (Millo 2017)
#"rho" for the average correlation coefficient
# These return identical results...why?
rwtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, test = "rho", w = fmat, effect = "twoways", index = c("fips", "year"))
# "cd" for Pesaran's CD statistic
rwtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, test = "cd", w = fmat, effect = "twoways", index = c("fips", "year"))
# "sclm" for the scaled version of Breusch and Pagan's LM statistic,
rwtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
data = allcomp_full, test = "sclm", w = fmat, effect = "twoways", index = c("fips", "year"))
# Below not required
#
# sphtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc, data = allcomp_full, effect = "twoways", listw = fmatlw, spatial.model = "error", method = "ML")
# sphtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc, data = allcomp_full, effect = "twoways", listw = fmatlw, spatial.model = "lag", method = "ML")
# sphtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc, data = allcomp_full, effect = "twoways", listw = fmatlw,spatial.model = "sarar",method = "ML")
# MORAN'S I TEST
#moran.lm<-lm.morantest(allcomp_full$diff_uer, fmatlw, alternative="two.sided")
# Vetor memory exhausted
# LAGRANGE MULTIPLIER TEST
# Locally robust LM tests for spatial lag (error) correlation sub spatial error (lag) correlation in panel models
#slmtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
# data = allcomp_full, listw = fmatlw, test="lme", model="within")
#slmtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
# data = allcomp_full, listw = fmatlw, test="lml", model="within")
#slmtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
# data = allcomp_full, listw = fmatlw, test="rlme", model="within")
#slmtest(diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc,
# data = allcomp_full, listw = fmatlw, test="rlml", model="within")
# This does not include 7 LA counties for which no employment indicators
# were recorded in 2005 and 2006. Therefore, use allcomp_full as created
# in the spatial matrix initiation section.
# Broomfield County, Colorado was only created in 2001 so no observation
# exists for 2001 - will replace with 0 for completeness. It is only the
# first observation...
allcomp_full$diff_log_realgdp_pc[which(allcomp_full$fips == "08014" & allcomp_full$year == 2002)] <- 0
allcomp_full$diff_log_realgdp[which(allcomp_full$fips == "08014" & allcomp_full$year == 2002)] <- 0
allcomp_full$diff_log_pop[which(allcomp_full$fips == "08014" & allcomp_full$year == 2002)] <- 0
fmdiff_uer <- diff_uer ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp_pc
# Required to extract Log Likelihood of error and SARAR model
#fixInNamespace("spsararlm", "splm")
#fixInNamespace("sperrorlm", "splm")
# (NOT DONE AS SPLAGLM RETURNS A MEASURE FOR LL)
#fixInNamespace("splaglm", "splm")
# This third function (which returns a value for loglikelihood, transforms it according to:
# ens <- as.numeric((time * ldet - ((n*time/2) * log(2 * pi)) - (n*time/2) * log(s2) - 1/(2 * s2) * SSE))
# and then returns ens instead of LL.......
#And manually add "ll=LL" as an element to the "return" list at the end of
#the function so that it reads:
#return <- list(coeff = betas, lambda = lambda, s2 = s2, rest.se = rest.se,
# lambda.se = lambda.se, asyvar1 = asyvar1, ll=LL)
sp_err_mines <- spml(fmdiff_uer, allcomp_full,
index = NULL, listw = fmatlw, lag = FALSE, na.action = na.fail,
spatial.error = "b", model = "within", effect = "twoways", quiet = FALSE)
Spatial Error Fixed Effects Model
Spatial fixed effects model
Jacobian calculated using neighbourhood matrix eigenvalues
Computing eigenvalues ...
rho: -0.4910988 function: -301880.6 Jacobian: -57.97902 SSE: 53155.03
rho: 0.07845029 function: -284733.9 Jacobian: -1.615293 SSE: 29657.86
rho: 0.430451 function: -275948.2 Jacobian: -54.78956 SSE: 20849.69
rho: 0.6479993 function: -272809.1 Jacobian: -139.9342 SSE: 17608.26
rho: 0.929466 function: -274515.6 Jacobian: -388.3001 SSE: 15933.04
rho: 0.7149123 function: -272460.3 Jacobian: -178.9056 SSE: 16951.91
rho: 0.7310491 function: -272432 Jacobian: -189.5428 SSE: 16817.68
rho: 0.7440642 function: -272426.3 Jacobian: -198.5226 SSE: 16716.23
rho: 0.7423415 function: -272426.2 Jacobian: -197.3126 SSE: 16729.31
rho: 0.7422213 function: -272426.2 Jacobian: -197.2284 SSE: 16730.23
rho: 0.7422316 function: -272426.2 Jacobian: -197.2356 SSE: 16730.15
rho: 0.7422315 function: -272426.2 Jacobian: -197.2355 SSE: 16730.15
rho: 0.7422315 function: -272426.2 Jacobian: -197.2356 SSE: 16730.15
rho: 0.7422315 function: -272426.2 Jacobian: -197.2356 SSE: 16730.15
rho: 0.7422315 function: -272426.2 Jacobian: -197.2356 SSE: 16730.15
sp_lag_mines <- spml(fmdiff_uer, allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail,
spatial.error = "none", model = "within", effect = "twoways", quiet = FALSE)
Spatial Lag Fixed Effects Model
Spatial fixed effects model
Jacobian calculated using neighbourhood matrix eigenvalues
Computing eigenvalues ...
lambda: -0.4910988 function value: -302042.5
lambda: 0.07845029 function value: -284710.5
lambda: 0.430451 function value: -275858.8
lambda: 0.6479993 function value: -272730.8
lambda: 0.9194395 function value: -274259.1
lambda: 0.7149204 function value: -272395
lambda: 0.7296516 function value: -272371.7
lambda: 0.7411351 function value: -272367.2
lambda: 0.7396672 function value: -272367.1
lambda: 0.7395721 function value: -272367.1
lambda: 0.7395797 function value: -272367.1
lambda: 0.7395796 function value: -272367.1
lambda: 0.7395796 function value: -272367.1
lambda: 0.7395796 function value: -272367.1
lambda: 0.7395796 function value: -272367.1
# Only used to test whether unadjusted loglikelihood yields different AIC and BIC results
# sp_lag_mines_unadjll <- spml(fmdiff_uer, allcomp_full, index = NULL, listw = fmatlw,
# lag = TRUE, na.action = na.fail,
# spatial.error = "none", model = "within", effect = "twoways", quiet = FALSE)
sp_err_lag_mines <- spml(fmdiff_uer, data = allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail, spatial.error = "b",
model = "within", effect = "twoways", quiet = FALSE)
Spatial SARAR Fixed Effects Model
Spatial fixed effects model
Jacobian calculated using neighbourhood matrix eigenvalues
Computing eigenvalues ...
neighbourhood matrix eigenvalues
Computing eigenvalues ...
lambda: -1.130119 rho: 0.8 function: -134542.5 Jacobian1: -310.7723 Jacobian2: -241.7962 SSE: 16296.86
lambda: -1.130119 rho: 0.8 function: -134542.5 Jacobian1: -310.7723 Jacobian2: -241.7962 SSE: 16296.86
lambda: -1.130119 rho: 0.8 function: -134542.5 Jacobian1: -310.7723 Jacobian2: -241.7962 SSE: 16296.86
lambda: -0.2784344 rho: 1 function: -132160.8 Jacobian1: -19.03328 Jacobian2: -590.3752 SSE: 14408.59
lambda: -0.278777 rho: 1 function: -132158.3 Jacobian1: -19.0793 Jacobian2: -590.3752 SSE: 14406.86
lambda: -0.2784344 rho: 0.9996574 function: -131613.2 Jacobian1: -19.03328 Jacobian2: -559.9158 SSE: 14408.9
lambda: 0.6973589 rho: 0.7813049 function: -136824 Jacobian1: -167.9175 Jacobian2: -226.4124 SSE: 19619.23
lambda: 0.1672697 rho: 0.7886324 function: -130005.9 Jacobian1: -7.522001 Jacobian2: -232.3227 SSE: 16953.65
lambda: 0.1672785 rho: 0.7886324 function: -130005.9 Jacobian1: -7.522813 Jacobian2: -232.3227 SSE: 16953.68
lambda: 0.1672697 rho: 0.7886326 function: -130005.9 Jacobian1: -7.522001 Jacobian2: -232.3228 SSE: 16953.65
lambda: -0.07936203 rho: 0.786421 function: -128660.4 Jacobian1: -1.59636 Jacobian2: -230.5233 SSE: 16229.79
lambda: -0.0788431 rho: 0.786421 function: -128662.1 Jacobian1: -1.575709 Jacobian2: -230.5233 SSE: 16230.98
lambda: -0.07936203 rho: 0.7864212 function: -128660.4 Jacobian1: -1.59636 Jacobian2: -230.5234 SSE: 16229.79
lambda: -0.3183288 rho: 0.8474699 function: -128075.2 Jacobian1: -24.75606 Jacobian2: -285.9649 SSE: 15097.2
lambda: -0.8427513 rho: 1 function: -130111 Jacobian1: -169.4238 Jacobian2: -590.3752 SSE: 12131.11
lambda: -0.3183263 rho: 0.8474699 function: -128075.2 Jacobian1: -24.75568 Jacobian2: -285.9649 SSE: 15097.2
lambda: -0.3183288 rho: 0.8474711 function: -128075.2 Jacobian1: -24.75606 Jacobian2: -285.9661 SSE: 15097.19
lambda: -1.087207 rho: 1 function: -130750 Jacobian1: -286.288 Jacobian2: -590.3752 SSE: 11505.23
lambda: -0.4515752 rho: 0.8913078 function: -127876 Jacobian1: -49.16736 Jacobian2: -335.3008 SSE: 14286.17
lambda: -0.4515716 rho: 0.8913078 function: -127876 Jacobian1: -49.16659 Jacobian2: -335.3008 SSE: 14286.18
lambda: -0.4515752 rho: 0.8913054 function: -127876 Jacobian1: -49.16736 Jacobian2: -335.2978 SSE: 14286.19
lambda: -0.5823026 rho: 0.840448 function: -128261.9 Jacobian1: -81.09045 Jacobian2: -278.9052 SSE: 14719.61
lambda: -0.4695 rho: 0.8638277 function: -127887.6 Jacobian1: -53.07414 Jacobian2: -303.2405 SSE: 14556.52
lambda: -0.459588 rho: 0.8790236 function: -127854.6 Jacobian1: -50.89544 Jacobian2: -320.4507 SSE: 14397.58
lambda: -0.4595763 rho: 0.8790236 function: -127854.6 Jacobian1: -50.8929 Jacobian2: -320.4507 SSE: 14397.61
lambda: -0.459588 rho: 0.8790249 function: -127854.6 Jacobian1: -50.89544 Jacobian2: -320.4523 SSE: 14397.57
lambda: -0.4716558 rho: 0.8873588 function: -127841.9 Jacobian1: -53.55399 Jacobian2: -330.4281 SSE: 14273.05
lambda: -0.4716525 rho: 0.8873588 function: -127841.9 Jacobian1: -53.55325 Jacobian2: -330.4281 SSE: 14273.06
lambda: -0.4716558 rho: 0.8873581 function: -127841.9 Jacobian1: -53.55399 Jacobian2: -330.4273 SSE: 14273.06
lambda: -0.5005359 rho: 0.8822236 function: -127821.3 Jacobian1: -60.19001 Jacobian2: -324.2335 SSE: 14258.34
lambda: -0.5005312 rho: 0.8822236 function: -127821.3 Jacobian1: -60.18892 Jacobian2: -324.2335 SSE: 14258.35
lambda: -0.5005359 rho: 0.8822244 function: -127821.3 Jacobian1: -60.19001 Jacobian2: -324.2343 SSE: 14258.33
lambda: -0.5559804 rho: 0.9013969 function: -127783.6 Jacobian1: -74.01913 Jacobian2: -348.2111 SSE: 13892.72
lambda: -0.5559777 rho: 0.9013969 function: -127783.6 Jacobian1: -74.0184 Jacobian2: -348.2111 SSE: 13892.73
lambda: -0.5559804 rho: 0.9013961 function: -127783.6 Jacobian1: -74.01913 Jacobian2: -348.2101 SSE: 13892.73
lambda: -0.6022142 rho: 0.9063162 function: -127776.7 Jacobian1: -86.65823 Jacobian2: -354.7648 SSE: 13716.79
lambda: -0.6022113 rho: 0.9063162 function: -127776.7 Jacobian1: -86.6574 Jacobian2: -354.7648 SSE: 13716.79
lambda: -0.6022142 rho: 0.9063169 function: -127776.7 Jacobian1: -86.65823 Jacobian2: -354.7657 SSE: 13716.78
lambda: -0.5939949 rho: 0.905218 function: -127776.4 Jacobian1: -84.33699 Jacobian2: -353.2862 SSE: 13750.61
lambda: -0.5939976 rho: 0.905218 function: -127776.4 Jacobian1: -84.33775 Jacobian2: -353.2862 SSE: 13750.6
lambda: -0.5939949 rho: 0.9052184 function: -127776.4 Jacobian1: -84.33699 Jacobian2: -353.2868 SSE: 13750.61
lambda: -0.5939949 rho: 0.9052175 function: -127776.4 Jacobian1: -84.33699 Jacobian2: -353.2855 SSE: 13750.62
lambda: -0.5942183 rho: 0.9053301 function: -127776.4 Jacobian1: -84.39967 Jacobian2: -353.4367 SSE: 13748.7
lambda: -0.5941876 rho: 0.9053301 function: -127776.4 Jacobian1: -84.39105 Jacobian2: -353.4367 SSE: 13748.78
lambda: -0.5942491 rho: 0.9053301 function: -127776.4 Jacobian1: -84.40829 Jacobian2: -353.4367 SSE: 13748.62
lambda: -0.5942183 rho: 0.9053317 function: -127776.4 Jacobian1: -84.39967 Jacobian2: -353.4389 SSE: 13748.68
lambda: -0.5942183 rho: 0.9053285 function: -127776.4 Jacobian1: -84.39967 Jacobian2: -353.4346 SSE: 13748.72
lambda: -0.5942139 rho: 0.9053127 function: -127776.4 Jacobian1: -84.39842 Jacobian2: -353.4134 SSE: 13748.92
lambda: -0.594183 rho: 0.9053127 function: -127776.4 Jacobian1: -84.38975 Jacobian2: -353.4134 SSE: 13749
lambda: -0.5942448 rho: 0.9053127 function: -127776.4 Jacobian1: -84.40709 Jacobian2: -353.4134 SSE: 13748.84
lambda: -0.5942139 rho: 0.9053179 function: -127776.4 Jacobian1: -84.39842 Jacobian2: -353.4204 SSE: 13748.86
lambda: -0.5942139 rho: 0.9053075 function: -127776.4 Jacobian1: -84.39842 Jacobian2: -353.4064 SSE: 13748.98
lambda: -0.5942131 rho: 0.9053127 function: -127776.4 Jacobian1: -84.39821 Jacobian2: -353.4133 SSE: 13748.92
lambda: -0.5941535 rho: 0.9053127 function: -127776.4 Jacobian1: -84.38148 Jacobian2: -353.4133 SSE: 13749.07
lambda: -0.5942728 rho: 0.9053127 function: -127776.4 Jacobian1: -84.41494 Jacobian2: -353.4133 SSE: 13748.77
lambda: -0.5942131 rho: 0.9053267 function: -127776.4 Jacobian1: -84.39821 Jacobian2: -353.4322 SSE: 13748.76
lambda: -0.5942131 rho: 0.9052986 function: -127776.4 Jacobian1: -84.39821 Jacobian2: -353.3945 SSE: 13749.09
lambda: -0.5942131 rho: 0.9053127 function: -127776.4 Jacobian1: -84.39821 Jacobian2: -353.4133 SSE: 13748.92
lambda: 0 rho: 0 function: -143439.3 Jacobian1: 0 Jacobian2: 0 SSE: 32217.36
lambda: 1.490116e-08 rho: 0 function: -143439.3 Jacobian1: -5.632049e-14 Jacobian2: 0 SSE: 32217.36
lambda: 0 rho: 1.490116e-08 function: -143439.3 Jacobian1: 0 Jacobian2: -5.632049e-14 SSE: 32217.36
lambda: 0.7108311 rho: 0.7033628 function: -135462.5 Jacobian1: -176.2982 Jacobian2: -171.6101 SSE: 19249.57
lambda: 0.7104842 rho: 0.7033628 function: -135455.7 Jacobian1: -176.0781 Jacobian2: -171.6101 SSE: 19247.64
lambda: 0.7108311 rho: 0.7030159 function: -135455.8 Jacobian1: -176.2982 Jacobian2: -171.3949 SSE: 19247.62
lambda: 1 rho: -0.2421222 function: -132467 Jacobian1: -590.3752 Jacobian2: -14.46308 SSE: 14612.42
lambda: 0.9999982 rho: -0.2421222 function: -132055.6 Jacobian1: -567.5233 Jacobian2: -14.46308 SSE: 14612.43
lambda: 1 rho: -0.2421203 function: -132467 Jacobian1: -590.3752 Jacobian2: -14.46287 SSE: 14612.43
lambda: 0.710725 rho: -1.199368 function: -140586.8 Jacobian1: -176.2309 Jacobian2: -353.1569 SSE: 20587.41
lambda: 0.7107436 rho: -0.6498819 function: -131922.2 Jacobian1: -176.2426 Jacobian2: -100.7608 SSE: 17736.08
lambda: 0.7500314 rho: -0.2421308 function: -128579.9 Jacobian1: -202.7657 Jacobian2: -14.4641 SSE: 16340.24
lambda: 0.7500314 rho: -0.2421308 function: -128579.9 Jacobian1: -202.7657 Jacobian2: -14.4641 SSE: 16340.24
lambda: 0.7500314 rho: -0.2419146 function: -128579.6 Jacobian1: -202.7657 Jacobian2: -14.43871 SSE: 16340.35
lambda: 0.7500378 rho: -0.1171465 function: -128567.4 Jacobian1: -202.7703 Jacobian2: -3.453915 SSE: 16450.27
lambda: 0.7500377 rho: -0.1171465 function: -128567.4 Jacobian1: -202.7703 Jacobian2: -3.453915 SSE: 16450.27
lambda: 0.7500378 rho: -0.117396 function: -128567.1 Jacobian1: -202.7703 Jacobian2: -3.468488 SSE: 16449.95
lambda: 0.7501855 rho: -0.1746336 function: -128536.4 Jacobian1: -202.8764 Jacobian2: -7.600774 SSE: 16386.4
lambda: 0.7501855 rho: -0.1746336 function: -128536.4 Jacobian1: -202.8763 Jacobian2: -7.600774 SSE: 16386.4
lambda: 0.7501855 rho: -0.1746311 function: -128536.4 Jacobian1: -202.8764 Jacobian2: -7.60056 SSE: 16386.4
lambda: 0.7503398 rho: -0.1758926 function: -128535.3 Jacobian1: -202.9872 Jacobian2: -7.709203 SSE: 16383.44
lambda: 0.7503397 rho: -0.1758926 function: -128535.3 Jacobian1: -202.9872 Jacobian2: -7.709203 SSE: 16383.44
lambda: 0.7503398 rho: -0.1758752 function: -128535.3 Jacobian1: -202.9872 Jacobian2: -7.707695 SSE: 16383.46
lambda: 0.7503398 rho: -0.1759101 function: -128535.3 Jacobian1: -202.9872 Jacobian2: -7.710711 SSE: 16383.43
lambda: 0.7520442 rho: -0.1812726 function: -128523.8 Jacobian1: -204.2155 Jacobian2: -8.180982 SSE: 16358.5
lambda: 0.7520441 rho: -0.1812726 function: -128523.8 Jacobian1: -204.2154 Jacobian2: -8.180982 SSE: 16358.5
lambda: 0.7520442 rho: -0.181271 function: -128523.8 Jacobian1: -204.2155 Jacobian2: -8.180836 SSE: 16358.5
lambda: 0.7520442 rho: -0.1812743 function: -128523.8 Jacobian1: -204.2155 Jacobian2: -8.181128 SSE: 16358.49
lambda: 0.7693085 rho: -0.2267794 function: -128405.2 Jacobian1: -217.0497 Jacobian2: -12.71593 SSE: 16105.34
lambda: 0.769308 rho: -0.2267794 function: -128405.2 Jacobian1: -217.0493 Jacobian2: -12.71593 SSE: 16105.35
lambda: 0.7693085 rho: -0.2267818 function: -128405.2 Jacobian1: -217.0497 Jacobian2: -12.71619 SSE: 16105.34
lambda: 0.838941 rho: -0.4085873 function: -127941.3 Jacobian1: -277.4162 Jacobian2: -40.40115 SSE: 14955.03
lambda: 0.9455844 rho: -0.6870291 function: -127928.6 Jacobian1: -414.9478 Jacobian2: -112.5182 SSE: 13040.98
lambda: 0.9455836 rho: -0.6870291 function: -127928.6 Jacobian1: -414.9464 Jacobian2: -112.5182 SSE: 13040.99
lambda: 0.9455844 rho: -0.6870314 function: -127928.6 Jacobian1: -414.9478 Jacobian2: -112.5189 SSE: 13040.97
lambda: 0.8389201 rho: -0.412414 function: -127941.1 Jacobian1: -277.3956 Jacobian2: -41.14705 SSE: 14947.86
lambda: 0.8879622 rho: -0.5532162 function: -127735.1 Jacobian1: -331.1665 Jacobian2: -73.29553 SSE: 14029.73
lambda: 0.8879629 rho: -0.5532162 function: -127735.1 Jacobian1: -331.1673 Jacobian2: -73.29553 SSE: 14029.72
lambda: 0.8879622 rho: -0.5532139 function: -127735.1 Jacobian1: -331.1665 Jacobian2: -73.29493 SSE: 14029.73
lambda: 0.8967247 rho: -0.5759109 function: -127723.4 Jacobian1: -342.1471 Jacobian2: -79.34319 SSE: 13869.19
lambda: 0.8967242 rho: -0.5759109 function: -127723.4 Jacobian1: -342.1464 Jacobian2: -79.34319 SSE: 13869.2
lambda: 0.8967247 rho: -0.5759069 function: -127723.4 Jacobian1: -342.1471 Jacobian2: -79.34209 SSE: 13869.2
lambda: 0.8967247 rho: -0.575915 function: -127723.4 Jacobian1: -342.1471 Jacobian2: -79.34429 SSE: 13869.18
lambda: 0.9020985 rho: -0.5920369 function: -127721.7 Jacobian1: -349.135 Jacobian2: -83.7888 SSE: 13765.46
lambda: 0.9020979 rho: -0.5920369 function: -127721.7 Jacobian1: -349.1342 Jacobian2: -83.7888 SSE: 13765.47
lambda: 0.9020985 rho: -0.5920346 function: -127721.7 Jacobian1: -349.135 Jacobian2: -83.78814 SSE: 13765.47
lambda: 0.901471 rho: -0.5906629 function: -127721.6 Jacobian1: -348.3085 Jacobian2: -83.40517 SSE: 13776.3
lambda: 0.9014716 rho: -0.5906629 function: -127721.6 Jacobian1: -348.3093 Jacobian2: -83.40517 SSE: 13776.29
lambda: 0.901471 rho: -0.5906592 function: -127721.6 Jacobian1: -348.3085 Jacobian2: -83.40415 SSE: 13776.31
lambda: 0.901471 rho: -0.5906666 function: -127721.6 Jacobian1: -348.3085 Jacobian2: -83.4062 SSE: 13776.29
lambda: 0.9014897 rho: -0.5908307 function: -127721.6 Jacobian1: -348.3331 Jacobian2: -83.45198 SSE: 13775.66
lambda: 0.9014964 rho: -0.5908307 function: -127721.6 Jacobian1: -348.342 Jacobian2: -83.45198 SSE: 13775.58
lambda: 0.9014829 rho: -0.5908307 function: -127721.6 Jacobian1: -348.3241 Jacobian2: -83.45198 SSE: 13775.74
lambda: 0.9014897 rho: -0.5908192 function: -127721.6 Jacobian1: -348.3331 Jacobian2: -83.44878 SSE: 13775.69
lambda: 0.9014897 rho: -0.5908421 function: -127721.6 Jacobian1: -348.3331 Jacobian2: -83.45517 SSE: 13775.63
lambda: 0.9014921 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3362 Jacobian2: -83.46264 SSE: 13775.53
lambda: 0.9015031 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3507 Jacobian2: -83.46264 SSE: 13775.4
lambda: 0.9014811 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3218 Jacobian2: -83.46264 SSE: 13775.66
lambda: 0.9014921 rho: -0.5908331 function: -127721.6 Jacobian1: -348.3362 Jacobian2: -83.45264 SSE: 13775.62
lambda: 0.9014921 rho: -0.5909048 function: -127721.6 Jacobian1: -348.3362 Jacobian2: -83.47264 SSE: 13775.44
lambda: 0.9014921 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3362 Jacobian2: -83.46264 SSE: 13775.53
lambda: 0.8 rho: 0.8 function: -139571.4 Jacobian1: -241.7962 Jacobian2: -241.7962 SSE: 20445.59
lambda: 0.8 rho: 0.8 function: -139571.4 Jacobian1: -241.7962 Jacobian2: -241.7962 SSE: 20445.59
lambda: 0.8 rho: 0.8 function: -139571.4 Jacobian1: -241.7962 Jacobian2: -241.7962 SSE: 20445.59
lambda: 0.09283866 rho: 0.09294779 function: -138371.7 Jacobian1: -2.270443 Jacobian2: -2.275847 SSE: 26742.54
lambda: 0.09318923 rho: 0.09294779 function: -138362.9 Jacobian1: -2.287828 Jacobian2: -2.275847 SSE: 26733.73
lambda: 0.09283866 rho: 0.09329835 function: -138363 Jacobian1: -2.270443 Jacobian2: -2.293254 SSE: 26733.82
lambda: 0.4708159 rho: 0.4202598 function: -129674.3 Jacobian1: -66.78193 Jacobian2: -51.99098 SSE: 18125.39
lambda: 0.4708141 rho: 0.4202598 function: -129674.3 Jacobian1: -66.78136 Jacobian2: -51.99098 SSE: 18125.39
lambda: 0.4708159 rho: 0.420258 function: -129674.3 Jacobian1: -66.78193 Jacobian2: -51.99049 SSE: 18125.39
lambda: 0.7998744 rho: 0.043802 function: -129239.2 Jacobian1: -241.6894 Jacobian2: -0.4993093 SSE: 16464.84
lambda: 0.7998762 rho: 0.043802 function: -129239.2 Jacobian1: -241.6909 Jacobian2: -0.4993093 SSE: 16464.83
lambda: 0.7998744 rho: 0.04380373 function: -129239.2 Jacobian1: -241.6894 Jacobian2: -0.4993491 SSE: 16464.84
lambda: 1 rho: -0.542533 function: -130696.3 Jacobian1: -590.3752 Jacobian2: -70.53276 SSE: 13214.64
lambda: 0.7961005 rho: -0.1328145 function: -128448.5 Jacobian1: -238.5035 Jacobian2: -4.427299 SSE: 15992.9
lambda: 0.7961018 rho: -0.1328145 function: -128448.5 Jacobian1: -238.5046 Jacobian2: -4.427299 SSE: 15992.89
lambda: 0.7961005 rho: -0.1328125 function: -128448.5 Jacobian1: -238.5035 Jacobian2: -4.427168 SSE: 15992.91
lambda: 0.8182767 rho: -0.3080738 function: -128090 Jacobian1: -257.8639 Jacobian2: -23.21505 SSE: 15399.62
lambda: 0.8182778 rho: -0.3080738 function: -128090 Jacobian1: -257.8649 Jacobian2: -23.21505 SSE: 15399.61
lambda: 0.8182767 rho: -0.3080713 function: -128090 Jacobian1: -257.8639 Jacobian2: -23.21467 SSE: 15399.63
lambda: 0.9991042 rho: -0.6116062 function: -129834 Jacobian1: -555.5822 Jacobian2: -89.35024 SSE: 12942.77
lambda: 0.8800595 rho: -0.3289181 function: -128075 Jacobian1: -321.6689 Jacobian2: -26.39802 SSE: 14734.42
lambda: 0.8800584 rho: -0.3289181 function: -128074.9 Jacobian1: -321.6676 Jacobian2: -26.39802 SSE: 14734.43
lambda: 0.8800595 rho: -0.3289154 function: -128075 Jacobian1: -321.6689 Jacobian2: -26.3976 SSE: 14734.43
lambda: 0.8514872 rho: -0.3446192 function: -127963 Jacobian1: -290.0968 Jacobian2: -28.92737 SSE: 14955.01
lambda: 0.851488 rho: -0.3446192 function: -127963 Jacobian1: -290.0977 Jacobian2: -28.92737 SSE: 14955
lambda: 0.8514872 rho: -0.3446157 function: -127963 Jacobian1: -290.0968 Jacobian2: -28.9268 SSE: 14955.02
lambda: 0.8671484 rho: -0.4079147 function: -127859.7 Jacobian1: -306.9002 Jacobian2: -40.27075 SSE: 14628.71
lambda: 0.914132 rho: -0.5978014 function: -127741.1 Jacobian1: -365.561 Jacobian2: -85.40799 SSE: 13614.27
lambda: 0.9141313 rho: -0.5978014 function: -127741.1 Jacobian1: -365.5599 Jacobian2: -85.40799 SSE: 13614.27
lambda: 0.914132 rho: -0.5977981 function: -127741.1 Jacobian1: -365.561 Jacobian2: -85.40705 SSE: 13614.28
lambda: 0.8112129 rho: -0.8374538 function: -130293.6 Jacobian1: -251.5258 Jacobian2: -167.2782 SSE: 15246.93
lambda: 0.8882542 rho: -0.601056 function: -127752 Jacobian1: -331.5245 Jacobian2: -86.32919 SSE: 13916.42
lambda: 0.9025995 rho: -0.5992518 function: -127722 Jacobian1: -349.7969 Jacobian2: -85.8179 SSE: 13741.52
lambda: 0.9026012 rho: -0.5992518 function: -127722 Jacobian1: -349.7992 Jacobian2: -85.8179 SSE: 13741.5
lambda: 0.9025995 rho: -0.5992463 function: -127722 Jacobian1: -349.7969 Jacobian2: -85.81634 SSE: 13741.53
lambda: 0.9009917 rho: -0.5877402 function: -127721.7 Jacobian1: -347.6791 Jacobian2: -82.59219 SSE: 13789.26
lambda: 0.9009922 rho: -0.5877402 function: -127721.7 Jacobian1: -347.6798 Jacobian2: -82.59219 SSE: 13789.26
lambda: 0.9009911 rho: -0.5877402 function: -127721.7 Jacobian1: -347.6784 Jacobian2: -82.59219 SSE: 13789.27
lambda: 0.9009917 rho: -0.5877436 function: -127721.7 Jacobian1: -347.6791 Jacobian2: -82.59314 SSE: 13789.25
lambda: 0.9014822 rho: -0.5908463 function: -127721.6 Jacobian1: -348.3232 Jacobian2: -83.45633 SSE: 13775.71
lambda: 0.9014893 rho: -0.5908463 function: -127721.6 Jacobian1: -348.3325 Jacobian2: -83.45633 SSE: 13775.62
lambda: 0.9014751 rho: -0.5908463 function: -127721.6 Jacobian1: -348.3139 Jacobian2: -83.45633 SSE: 13775.79
lambda: 0.9014822 rho: -0.5908436 function: -127721.6 Jacobian1: -348.3232 Jacobian2: -83.45559 SSE: 13775.71
lambda: 0.901492 rho: -0.5908711 function: -127721.6 Jacobian1: -348.3361 Jacobian2: -83.46325 SSE: 13775.53
lambda: 0.9015012 rho: -0.5908711 function: -127721.6 Jacobian1: -348.3482 Jacobian2: -83.46325 SSE: 13775.42
lambda: 0.9014828 rho: -0.5908711 function: -127721.6 Jacobian1: -348.324 Jacobian2: -83.46325 SSE: 13775.64
lambda: 0.901492 rho: -0.5908149 function: -127721.6 Jacobian1: -348.3361 Jacobian2: -83.44756 SSE: 13775.67
lambda: 0.901492 rho: -0.5909274 function: -127721.6 Jacobian1: -348.3361 Jacobian2: -83.47895 SSE: 13775.39
lambda: 0.901492 rho: -0.5908711 function: -127721.6 Jacobian1: -348.3361 Jacobian2: -83.46325 SSE: 13775.53
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 1 rho: -0.2781232 function: -132196.8 Jacobian1: -590.3752 Jacobian2: -18.99152 SSE: 14427.72
lambda: 0.9996573 rho: -0.2781232 function: -131648.9 Jacobian1: -559.9153 Jacobian2: -18.99152 SSE: 14427.92
lambda: 1 rho: -0.2784659 function: -132194.3 Jacobian1: -590.3752 Jacobian2: -19.03751 SSE: 14425.98
lambda: 0.7895168 rho: 0.1055055 function: -129542.2 Jacobian1: -233.0463 Jacobian2: -2.941942 SSE: 16713.61
lambda: 0.7895169 rho: 0.1055055 function: -129542.2 Jacobian1: -233.0464 Jacobian2: -2.941942 SSE: 16713.6
lambda: 0.7895168 rho: 0.1055143 function: -129542.3 Jacobian1: -233.0463 Jacobian2: -2.942445 SSE: 16713.64
lambda: 0.7877612 rho: -0.1132763 function: -128500.2 Jacobian1: -231.6121 Jacobian2: -3.231721 SSE: 16107.45
lambda: 0.7877613 rho: -0.1132763 function: -128500.2 Jacobian1: -231.6122 Jacobian2: -3.231721 SSE: 16107.44
lambda: 0.7877612 rho: -0.1129681 function: -128501.1 Jacobian1: -231.6121 Jacobian2: -3.21434 SSE: 16108.13
lambda: 0.8258984 rho: -0.3287155 function: -128041.3 Jacobian1: -264.8942 Jacobian2: -26.36613 SSE: 15270.98
lambda: 0.9413767 rho: -0.5781074 function: -127988.7 Jacobian1: -407.6739 Jacobian2: -79.94146 SSE: 13412.89
lambda: 0.9413778 rho: -0.5781074 function: -127988.8 Jacobian1: -407.6758 Jacobian2: -79.94146 SSE: 13412.88
lambda: 0.9413767 rho: -0.5781049 function: -127988.7 Jacobian1: -407.6739 Jacobian2: -79.94077 SSE: 13412.9
lambda: 0.8107339 rho: -1.049911 function: -132632.9 Jacobian1: -251.1019 Jacobian2: -266.0438 SSE: 15564.1
lambda: 0.8539825 rho: -0.5895475 function: -128001.2 Jacobian1: -292.6986 Jacobian2: -83.09442 SSE: 14432.31
lambda: 0.8981275 rho: -0.5837688 function: -127722.6 Jacobian1: -343.9519 Jacobian2: -81.49401 SSE: 13833.09
lambda: 0.8981287 rho: -0.5837688 function: -127722.6 Jacobian1: -343.9534 Jacobian2: -81.49401 SSE: 13833.07
lambda: 0.8981275 rho: -0.5837607 function: -127722.6 Jacobian1: -343.9519 Jacobian2: -81.49177 SSE: 13833.11
lambda: 0.9032025 rho: -0.608863 function: -127723.3 Jacobian1: -350.5959 Jacobian2: -88.55958 SSE: 13710.53
lambda: 0.9007353 rho: -0.5930868 function: -127721.8 Jacobian1: -347.3431 Jacobian2: -84.08252 SSE: 13778.98
lambda: 0.9007347 rho: -0.5930868 function: -127721.8 Jacobian1: -347.3423 Jacobian2: -84.08252 SSE: 13778.98
lambda: 0.9007353 rho: -0.5930909 function: -127721.8 Jacobian1: -347.3431 Jacobian2: -84.08365 SSE: 13778.97
lambda: 0.9023481 rho: -0.5836243 function: -127722.4 Jacobian1: -349.4646 Jacobian2: -81.4542 SSE: 13783.82
lambda: 0.9025296 rho: -0.5904958 function: -127721.8 Jacobian1: -349.7044 Jacobian2: -83.35859 SSE: 13764.28
lambda: 0.9025287 rho: -0.5904958 function: -127721.8 Jacobian1: -349.7032 Jacobian2: -83.35859 SSE: 13764.3
lambda: 0.9025296 rho: -0.5905002 function: -127721.8 Jacobian1: -349.7044 Jacobian2: -83.35981 SSE: 13764.27
lambda: 0.9014317 rho: -0.5905633 function: -127721.6 Jacobian1: -348.2568 Jacobian2: -83.37741 SSE: 13777.01
lambda: 0.9014323 rho: -0.5905633 function: -127721.6 Jacobian1: -348.2576 Jacobian2: -83.37741 SSE: 13777
lambda: 0.9014317 rho: -0.5905605 function: -127721.6 Jacobian1: -348.2568 Jacobian2: -83.37663 SSE: 13777.02
lambda: 0.9015058 rho: -0.5909612 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.48837 SSE: 13775.14
lambda: 0.9015124 rho: -0.5909612 function: -127721.6 Jacobian1: -348.363 Jacobian2: -83.48837 SSE: 13775.06
lambda: 0.9014993 rho: -0.5909612 function: -127721.6 Jacobian1: -348.3457 Jacobian2: -83.48837 SSE: 13775.22
lambda: 0.9015058 rho: -0.5909491 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.485 SSE: 13775.17
lambda: 0.9015058 rho: -0.5909733 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.49175 SSE: 13775.11
lambda: 0.9014919 rho: -0.5908689 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46263 SSE: 13775.54
lambda: 0.9015058 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3542 Jacobian2: -83.46263 SSE: 13775.37
lambda: 0.9014781 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3178 Jacobian2: -83.46263 SSE: 13775.7
lambda: 0.9014919 rho: -0.5908425 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.45528 SSE: 13775.6
lambda: 0.9014919 rho: -0.5908952 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46997 SSE: 13775.47
lambda: 0.9014919 rho: -0.5908686 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46256 SSE: 13775.54
lambda: 0.9015063 rho: -0.5908686 function: -127721.6 Jacobian1: -348.3549 Jacobian2: -83.46256 SSE: 13775.37
lambda: 0.9014776 rho: -0.5908686 function: -127721.6 Jacobian1: -348.3172 Jacobian2: -83.46256 SSE: 13775.71
lambda: 0.9014919 rho: -0.590809 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.44593 SSE: 13775.69
lambda: 0.9014919 rho: -0.5909282 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.47919 SSE: 13775.39
lambda: 0.9014919 rho: -0.5908686 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46256 SSE: 13775.54
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 0.8 rho: -1.130119 function: -134272.5 Jacobian1: -241.7962 Jacobian2: -310.7723 SSE: 16138.49
lambda: 1 rho: -0.2781232 function: -132196.8 Jacobian1: -590.3752 Jacobian2: -18.99152 SSE: 14427.72
lambda: 0.9996573 rho: -0.2781232 function: -131648.9 Jacobian1: -559.9153 Jacobian2: -18.99152 SSE: 14427.92
lambda: 1 rho: -0.2784659 function: -132194.3 Jacobian1: -590.3752 Jacobian2: -19.03751 SSE: 14425.98
lambda: 0.7895168 rho: 0.1055055 function: -129542.2 Jacobian1: -233.0463 Jacobian2: -2.941942 SSE: 16713.61
lambda: 0.7895169 rho: 0.1055055 function: -129542.2 Jacobian1: -233.0464 Jacobian2: -2.941942 SSE: 16713.6
lambda: 0.7895168 rho: 0.1055143 function: -129542.3 Jacobian1: -233.0463 Jacobian2: -2.942445 SSE: 16713.64
lambda: 0.7877612 rho: -0.1132763 function: -128500.2 Jacobian1: -231.6121 Jacobian2: -3.231721 SSE: 16107.45
lambda: 0.7877613 rho: -0.1132763 function: -128500.2 Jacobian1: -231.6122 Jacobian2: -3.231721 SSE: 16107.44
lambda: 0.7877612 rho: -0.1129681 function: -128501.1 Jacobian1: -231.6121 Jacobian2: -3.21434 SSE: 16108.13
lambda: 0.8258984 rho: -0.3287155 function: -128041.3 Jacobian1: -264.8942 Jacobian2: -26.36613 SSE: 15270.98
lambda: 0.9413767 rho: -0.5781074 function: -127988.7 Jacobian1: -407.6739 Jacobian2: -79.94146 SSE: 13412.89
lambda: 0.9413778 rho: -0.5781074 function: -127988.8 Jacobian1: -407.6758 Jacobian2: -79.94146 SSE: 13412.88
lambda: 0.9413767 rho: -0.5781049 function: -127988.7 Jacobian1: -407.6739 Jacobian2: -79.94077 SSE: 13412.9
lambda: 0.8107339 rho: -1.049911 function: -132632.9 Jacobian1: -251.1019 Jacobian2: -266.0438 SSE: 15564.1
lambda: 0.8539825 rho: -0.5895475 function: -128001.2 Jacobian1: -292.6986 Jacobian2: -83.09442 SSE: 14432.31
lambda: 0.8981275 rho: -0.5837688 function: -127722.6 Jacobian1: -343.9519 Jacobian2: -81.49401 SSE: 13833.09
lambda: 0.8981287 rho: -0.5837688 function: -127722.6 Jacobian1: -343.9534 Jacobian2: -81.49401 SSE: 13833.07
lambda: 0.8981275 rho: -0.5837607 function: -127722.6 Jacobian1: -343.9519 Jacobian2: -81.49177 SSE: 13833.11
lambda: 0.9032025 rho: -0.608863 function: -127723.3 Jacobian1: -350.5959 Jacobian2: -88.55958 SSE: 13710.53
lambda: 0.9007353 rho: -0.5930868 function: -127721.8 Jacobian1: -347.3431 Jacobian2: -84.08252 SSE: 13778.98
lambda: 0.9007347 rho: -0.5930868 function: -127721.8 Jacobian1: -347.3423 Jacobian2: -84.08252 SSE: 13778.98
lambda: 0.9007353 rho: -0.5930909 function: -127721.8 Jacobian1: -347.3431 Jacobian2: -84.08365 SSE: 13778.97
lambda: 0.9023481 rho: -0.5836243 function: -127722.4 Jacobian1: -349.4646 Jacobian2: -81.4542 SSE: 13783.82
lambda: 0.9025296 rho: -0.5904958 function: -127721.8 Jacobian1: -349.7044 Jacobian2: -83.35859 SSE: 13764.28
lambda: 0.9025287 rho: -0.5904958 function: -127721.8 Jacobian1: -349.7032 Jacobian2: -83.35859 SSE: 13764.3
lambda: 0.9025296 rho: -0.5905002 function: -127721.8 Jacobian1: -349.7044 Jacobian2: -83.35981 SSE: 13764.27
lambda: 0.9014317 rho: -0.5905633 function: -127721.6 Jacobian1: -348.2568 Jacobian2: -83.37741 SSE: 13777.01
lambda: 0.9014323 rho: -0.5905633 function: -127721.6 Jacobian1: -348.2576 Jacobian2: -83.37741 SSE: 13777
lambda: 0.9014317 rho: -0.5905605 function: -127721.6 Jacobian1: -348.2568 Jacobian2: -83.37663 SSE: 13777.02
lambda: 0.9015058 rho: -0.5909612 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.48837 SSE: 13775.14
lambda: 0.9015124 rho: -0.5909612 function: -127721.6 Jacobian1: -348.363 Jacobian2: -83.48837 SSE: 13775.06
lambda: 0.9014993 rho: -0.5909612 function: -127721.6 Jacobian1: -348.3457 Jacobian2: -83.48837 SSE: 13775.22
lambda: 0.9015058 rho: -0.5909491 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.485 SSE: 13775.17
lambda: 0.9015058 rho: -0.5909733 function: -127721.6 Jacobian1: -348.3543 Jacobian2: -83.49175 SSE: 13775.11
lambda: 0.9014919 rho: -0.5908689 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46263 SSE: 13775.54
lambda: 0.9015058 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3542 Jacobian2: -83.46263 SSE: 13775.37
lambda: 0.9014781 rho: -0.5908689 function: -127721.6 Jacobian1: -348.3178 Jacobian2: -83.46263 SSE: 13775.7
lambda: 0.9014919 rho: -0.5908425 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.45528 SSE: 13775.6
lambda: 0.9014919 rho: -0.5908952 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46997 SSE: 13775.47
lambda: 0.9014919 rho: -0.5908686 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46256 SSE: 13775.54
lambda: 0.9015063 rho: -0.5908686 function: -127721.6 Jacobian1: -348.3549 Jacobian2: -83.46256 SSE: 13775.37
lambda: 0.9014776 rho: -0.5908686 function: -127721.6 Jacobian1: -348.3172 Jacobian2: -83.46256 SSE: 13775.71
lambda: 0.9014919 rho: -0.590809 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.44593 SSE: 13775.69
lambda: 0.9014919 rho: -0.5909282 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.47919 SSE: 13775.39
lambda: 0.9014919 rho: -0.5908686 function: -127721.6 Jacobian1: -348.336 Jacobian2: -83.46256 SSE: 13775.54
# sp_err_mines$logLik
# sp_lag_mines$logLik
# sp_lag_mines_unadjll$logLik
# sp_err_lag_mines$logLik
# summary(sp_err_mines)
# summary(sp_lag_mines)
# summary(sp_lag_mines_unadjll)
# summary(sp_err_lag_mines)
sparse.W <- listw2dgCMatrix(fmatlw)
time <- length(unique(allcomp_full$year))
s.lwcounties <- kronecker(Matrix::Diagonal(time), sparse.W)
trMatc <- spatialreg::trW(s.lwcounties, type="mult")
implag <- spatialreg::impacts(sp_lag_mines, tr = trMatc, R = 200)
imperrlag <- spatialreg::impacts(sp_err_lag_mines, tr = trMatc, R = 200)
summary(sp_err_mines)
Spatial panel fixed effects error model
Call:
spml(formula = fmdiff_uer, data = allcomp_full, index = NULL,
listw = fmatlw, na.action = na.fail, model = "within", effect = "twoways",
lag = FALSE, spatial.error = "b", quiet = FALSE)
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-8.7738952 -0.3734312 0.0050779 0.3656829 10.1785341
Spatial error parameter:
Estimate Std. Error t-value Pr(>|t|)
rho 0.7422315 0.0036162 205.25 < 2.2e-16 ***
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
mines_diff -0.0255521 0.0042560 -6.0037 1.928e-09 ***
lag_diff -0.0093789 0.0041154 -2.2790 0.02267 *
lag_diff2 0.0205106 0.0040036 5.1230 3.007e-07 ***
diff_log_realgdp_pc -0.5434661 0.0300190 -18.1041 < 2.2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(implag, zstats=TRUE, short=TRUE)
Impact measures (lag, trace):
Direct Indirect Total
mines_diff -0.035802540 -0.08197462 -0.11777716
lag_diff -0.008906544 -0.02039270 -0.02929925
lag_diff2 0.027806380 0.06366636 0.09147274
diff_log_realgdp_pc -0.650749889 -1.48997733 -2.14072722
========================================================
Simulation results ( variance matrix):
========================================================
Simulated standard errors
Direct Indirect Total
mines_diff 0.004452784 0.010248575 0.01467281
lag_diff 0.004533657 0.010363744 0.01489543
lag_diff2 0.004106934 0.009485079 0.01357497
diff_log_realgdp_pc 0.030339533 0.073921998 0.10301104
Simulated z-values:
Direct Indirect Total
mines_diff -7.978939 -7.953539 -7.976725
lag_diff -2.053593 -2.058539 -2.057305
lag_diff2 6.738775 6.694713 6.716450
diff_log_realgdp_pc -21.366461 -20.120401 -20.731647
Simulated p-values:
Direct Indirect Total
mines_diff 1.5543e-15 1.7764e-15 1.5543e-15
lag_diff 0.040015 0.039538 0.039657
lag_diff2 1.5973e-11 2.1610e-11 1.8620e-11
diff_log_realgdp_pc < 2.22e-16 < 2.22e-16 < 2.22e-16
summary(imperrlag, zstats=TRUE, short=TRUE)
Impact measures (lag, trace):
Direct Indirect Total
mines_diff -0.035672461 -0.21468589 -0.25035835
lag_diff -0.007526441 -0.04529603 -0.05282247
lag_diff2 0.027054545 0.16282110 0.18987564
diff_log_realgdp_pc -0.549659757 -3.30799147 -3.85765123
========================================================
Simulation results ( variance matrix):
========================================================
Simulated standard errors
Direct Indirect Total
mines_diff 0.004650505 0.02829550 0.03289168
lag_diff 0.004126668 0.02491662 0.02904013
lag_diff2 0.004218824 0.02580231 0.02998923
diff_log_realgdp_pc 0.032521515 0.21763109 0.24861457
Simulated z-values:
Direct Indirect Total
mines_diff -7.672573 -7.591105 -7.615161
lag_diff -1.798661 -1.794389 -1.795192
lag_diff2 6.447663 6.346919 6.367845
diff_log_realgdp_pc -16.969292 -15.267935 -15.584945
Simulated p-values:
Direct Indirect Total
mines_diff 1.6875e-14 3.1752e-14 2.6423e-14
lag_diff 0.072072 0.072751 0.072623
lag_diff2 1.1359e-10 2.1967e-10 1.9170e-10
diff_log_realgdp_pc < 2.22e-16 < 2.22e-16 < 2.22e-16
mainfull <- feols(FE_diffuer, allcomp_full, se = 'twoway')
merged <- allcomp_full %>%
mutate(residuals_lag = residuals(sp_lag_mines), residuals_lagerr = residuals(sp_err_lag_mines), residuals_err = residuals(sp_err_mines), residuals_main = residuals(mainfull))
#moran.mc(merged$residuals_lag, listw = fmatlw, 1000, zero.policy = TRUE)
for(i in 2002:2019){
print(moran.mc(merged$residuals_lag[which(merged$year == i)], listw = fmatlw, 1000, zero.policy = TRUE))
}
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.0061992, observed rank = 723, p-value = 0.2777
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.010425, observed rank = 169, p-value = 0.8312
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.017103, observed rank = 963, p-value = 0.03796
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.0025806, observed rank = 419, p-value = 0.5814
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.016705, observed rank = 54, p-value = 0.9461
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.0048322, observed rank = 353, p-value = 0.6474
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.0062847, observed rank = 747, p-value = 0.2537
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.0030046, observed rank = 377, p-value = 0.6234
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.0078975, observed rank = 768, p-value = 0.2328
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.017114, observed rank = 947, p-value = 0.05395
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.00071451, observed rank = 516, p-value = 0.4845
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.008323, observed rank = 232, p-value = 0.7682
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.044618, observed rank = 1, p-value = 0.999
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.018287, observed rank = 973, p-value = 0.02797
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.017559, observed rank = 51, p-value = 0.9491
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.019592, observed rank = 968, p-value = 0.03297
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = -0.0070236, observed rank = 262, p-value = 0.7383
alternative hypothesis: greater
Monte-Carlo simulation of Moran I
data: merged$residuals_lag[which(merged$year == i)]
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.0065969, observed rank = 750, p-value = 0.2507
alternative hypothesis: greater
mergedp <- pdata.frame(merged, index = c("fips", "year"))
#moran.mc(mergedp$residuals_lag, listw = fmatlw, 1000, zero.policy = TRUE)
# PCD cross-sectional dependence of residuals:
# Main: reject independence: p-value: 2.2e-16
# rho: 0.0047673
pcdtest(mergedp$residuals_main, test = "cd")
Pesaran CD test for cross-sectional dependence in panels
data: mergedp$residuals_main
z = 43.928, p-value < 2.2e-16
alternative hypothesis: cross-sectional dependence
pcdtest(mergedp$residuals_main, test = "rho")
Average correlation coefficient for cross-sectional dependence in
panels
data: mergedp$residuals_main
rho = 0.0047673
alternative hypothesis: cross-sectional dependence
# SAR: reject independence: p-value: 0.01644
# rho: -0.00026
pcdtest(mergedp$residuals_err,listw = fmatlw, test = "cd")
Pesaran CD test for cross-sectional dependence in panels
data: mergedp$residuals_err
z = -2.399, p-value = 0.01644
alternative hypothesis: cross-sectional dependence
pcdtest(mergedp$residuals_err,listw = fmatlw, test = "rho")
Average correlation coefficient for cross-sectional dependence in
panels
data: mergedp$residuals_err
rho = -0.00026035
alternative hypothesis: cross-sectional dependence
# SLM: reject independence: p-value: 0.036
# rho: -0.00027
pcdtest(mergedp$residuals_lag, listw = fmatlw,test = "cd")
Pesaran CD test for cross-sectional dependence in panels
data: mergedp$residuals_lag
z = -2.0979, p-value = 0.03591
alternative hypothesis: cross-sectional dependence
pcdtest(mergedp$residuals_lag, listw = fmatlw,test = "rho")
Average correlation coefficient for cross-sectional dependence in
panels
data: mergedp$residuals_lag
rho = -0.00022767
alternative hypothesis: cross-sectional dependence
# SARAR: reject independence: p-value: 0.0425
# rho: -0.00022
pcdtest(mergedp$residuals_lagerr, listw = fmatlw, test = "cd")
Pesaran CD test for cross-sectional dependence in panels
data: mergedp$residuals_lagerr
z = -2.0291, p-value = 0.04245
alternative hypothesis: cross-sectional dependence
pcdtest(mergedp$residuals_lagerr, listw = fmatlw, test = "rho")
Average correlation coefficient for cross-sectional dependence in
panels
data: mergedp$residuals_lagerr
rho = -0.00022021
alternative hypothesis: cross-sectional dependence
ssr_spatial <- merged %>%
group_by(fips) %>%
summarise(ssr_err = sum(residuals_err^2), ssr_lag = sum(residuals_lag^2), ssr_errlag = sum(residuals_lagerr^2), ssr_main = sum(residuals_main^2))
moran.mc(ssr_spatial$ssr_main, listw = fmatlw, 1000, zero.policy = TRUE)
Monte-Carlo simulation of Moran I
data: ssr_spatial$ssr_main
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.26559, observed rank = 1001, p-value = 0.000999
alternative hypothesis: greater
moran.mc(ssr_spatial$ssr_err, listw = fmatlw, 1000, zero.policy = TRUE)
Monte-Carlo simulation of Moran I
data: ssr_spatial$ssr_err
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.30496, observed rank = 1001, p-value = 0.000999
alternative hypothesis: greater
moran.mc(ssr_spatial$ssr_lag, listw = fmatlw, 1000, zero.policy = TRUE)
Monte-Carlo simulation of Moran I
data: ssr_spatial$ssr_lag
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.27423, observed rank = 1001, p-value = 0.000999
alternative hypothesis: greater
moran.mc(ssr_spatial$ssr_errlag, listw = fmatlw, 1000, zero.policy = TRUE)
Monte-Carlo simulation of Moran I
data: ssr_spatial$ssr_errlag
weights: fmatlw
number of simulations + 1: 1001
statistic = 0.27003, observed rank = 1001, p-value = 0.000999
alternative hypothesis: greater
ssr_spatial <- df_va(ssr_spatial)
for (i in 1:length(names(ssr_spatial)[-1])){
mod = names(ssr_spatial[i+1])
k <- plot_usmap(data = ssr_spatial, values = mod, regions = "counties", col = "black", size = 0.07, exclude = c("AK", "HI" )) +
labs(title = paste0("Geographical Distribution of SSR in ",mod,"model")) +
scale_fill_viridis(name = "ssr", na.value = "seashell2") +
theme(panel.background = element_rect(colour = "black", fill = "gray90"))
print(k)
}
sp_err <- dw_compat(sp_err_mines)
sp_lag <- dw_compat_imp(implag)
sp_lag$model <- "SLM"
sp_errlag <- dw_compat_imp(imperrlag)
sp_errlag$model <- "SARAR"
spat_models <- rbind(sp_err[2:4,], sp_lag[1:3,], sp_errlag[1:3,])
# Spatial Durbin model here!
# library(spatialreg)
# lagsarlm(fmdiff_uer, allcomp_LA, listw = fmatlw, na.action = na.fail, Durbin = TRUE)
fmdiff_employed <- diff_log_employed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop
emp_spat <- spml(fmdiff_employed, data = allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail, spatial.error = "b",
model = "within", effect = "twoways", quiet = FALSE)
impemp_spat <- spatialreg::impacts(emp_spat, tr = trMatc, R = 200)
summary(impemp_spat, zstats=TRUE, short=TRUE)
fmdiff_unemp <- diff_log_unemployed ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop
unemp_spat <- spml(fmdiff_unemp, data = allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail, spatial.error = "b",
model = "within", effect = "twoways", quiet = FALSE)
imp_unemp_spat <- spatialreg::impacts(unemp_spat, tr = trMatc, R = 200)
summary(imp_unemp_spat, zstats=TRUE, short=TRUE)
fmdiff_lf <- diff_log_lf ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp + diff_log_pop
lf_spat <- spml(fmdiff_lf, data = allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail, spatial.error = "b",
model = "within", effect = "twoways", quiet = FALSE)
imp_lf_spat <- spatialreg::impacts(lf_spat, tr = trMatc, R = 200)
summary(imp_lf_spat, zstats=TRUE, short=TRUE)
fmdiff_pop <- diff_log_pop ~ mines_diff + lag_diff + lag_diff2 + diff_log_realgdp
pop_spat <- spml(fmdiff_pop, data = allcomp_full, index = NULL, listw = fmatlw,
lag = TRUE, na.action = na.fail, spatial.error = "b",
model = "within", effect = "twoways", quiet = FALSE)
imp_pop_spat <- spatialreg::impacts(pop_spat, tr = trMatc, R = 200)
summary(imp_pop_spat, zstats=TRUE, short=TRUE)
tab2 <- cbind(spat_output(impemp_spat)[-4],
spat_output(imp_unemp_spat)[-4],
spat_output(imp_lf_spat)[-4],
spat_output(imp_pop_spat)[-4])
kable(tab2[,1:6], booktabs=TRUE, format = "latex") %>%
add_header_above(setNames(c("", 3, 3), c("", "Employed Persons", "Unemployed Persons"))) %>%
kable_styling(position="center")
kable(tab2[,7:12], booktabs=TRUE, format = "latex") %>%
add_header_above(setNames(c("", 3, 3), c("", "Labour Force", "Population"))) %>%
kable_styling(position="center")
Don’t see immediate cause for concern? Perhaps some clustering in the southwest/appalachia but the counties themselves are also smaller in size so might optically trick?
glht(main, linfct = "mines_diff + lag_diff + lag_diff2 = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = FE_diffuer, data = allcomp, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff + lag_diff + lag_diff2 == 0 -0.02443 0.02690 -0.908 0.364
(Adjusted p values reported -- single-step method)
glht(main_cc, linfct = "mines_diff + lag_diff + lag_diff2 = 0") %>% summary
Simultaneous Tests for General Linear Hypotheses
Fit: feols(fml = FE_diffuer, data = allcomp_cc, se = "twoway")
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
mines_diff + lag_diff + lag_diff2 == 0 -0.01171 0.02216 -0.528 0.597
(Adjusted p values reported -- single-step method)
ssr_df <- allcomp %>% slice(main$obs_selection$obsRemoved) %>% mutate(residuals = main$residuals) %>%
group_by(fips) %>%
summarise(ssr = sum(residuals^2))
allcompva <- df_va(allcomp)
ssr_df_va <- df_va(ssr_df)
plot_usmap(data = ssr_df_va, values = "ssr", regions = "counties", col = "black", size = 0.07, exclude = c("AK", "HI" )) +
labs(title = "Geographical Distribution of SSR") +
scale_fill_viridis(name = "ssr", na.value = "seashell2") +
theme(panel.background = element_rect(colour = "black", fill = "gray90"))
hist(ssr_df$ssr)
means_overall <- allcomp %>%
group_by(fips) %>%
summarize(uer = mean(uer), REE_scaled = sum(REE_inv_scaled_realgdp))
means_overallva <- df_va(means_overall)
hist(allcompva$mines_diff[allcompva$mines_diff != 0])
summary(allcompva$mines_diff[allcompva$mines_diff != 0])
Min. 1st Qu. Median Mean 3rd Qu. Max.
-30.000 -2.000 -1.000 -0.468 1.000 20.000
plot_usmap(data = filter(allcompva, year == 2019), values = "uer", regions = "counties", col = "black", size = 0.07, exclude = c("AK", "HI" )) +
labs(title = "Geographical Distribution of Unemployment Rate in 2019") +
scale_fill_viridis(name = "uer", na.value = "seashell2", direction = -1, option = "magma") +
theme(panel.background = element_rect(color = "black", fill = "gray90"), legend.position = "left")
This would ideally be animated or grid arranged but have not yet figured it out :)
# Goal: animate or grid.arrange
uer_list = list()
for(i in 2002:2019){
j = i - 2001
p1 <- plot_usmap(data = filter(allcompva, year == i), values = "uer", regions = "counties", col = "black", size = 0.07, exclude = c("AK", "HI" )) +
labs(title = paste0("Geographical Distribution of Unemployment Rate in ", i)) +
scale_fill_viridis(name = "uer", na.value = "seashell2", direction = -1) +
theme(panel.background = element_rect(color = "black", fill = "gray90"), legend.position = "left")
print(p1)
uer_list[[j]] <- p1
}